After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 793472 - Using marker instances after finallized
Using marker instances after finallized
Status: RESOLVED FIXED
Product: gnome-maps
Classification: Applications
Component: map view
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-maps-maint
gnome-maps-maint
Depends on:
Blocks:
 
 
Reported: 2018-02-14 22:01 UTC by Marcus Lundblad
Modified: 2018-02-14 22:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mapView: Invalidate current turn point marker when removed (2.45 KB, patch)
2018-02-14 22:02 UTC, Marcus Lundblad
committed Details | Review
mapMarker: Bind properties from MapView (3.10 KB, patch)
2018-02-14 22:02 UTC, Marcus Lundblad
committed Details | Review
turnPointMarker: Avoid signal callback on finallized instance (1.31 KB, patch)
2018-02-14 22:02 UTC, Marcus Lundblad
committed Details | Review
userLocationMarker: Use bound view properties (2.04 KB, patch)
2018-02-14 22:02 UTC, Marcus Lundblad
committed Details | Review

Description Marcus Lundblad 2018-02-14 22:01:20 UTC
In some cases, signal callbacks causes access from JS on already finallized instances of MapMarker, resulting in traces such as:

(org.gnome.Maps:22398): Gjs-CRITICAL **: Object .Gjs_TurnPointMarker (0x55b4af865c00), has been already finalized. Impossible to get any property from it.
== Stack trace for context 0x55b4adea8000 ==
Comment 1 Marcus Lundblad 2018-02-14 22:02:01 UTC
Created attachment 368356 [details] [review]
mapView: Invalidate current turn point marker when removed

Always null out the reference to the current turn point marker
when removing from instruction layer to avoid destroying an
already finalized object.
Comment 2 Marcus Lundblad 2018-02-14 22:02:13 UTC
Created attachment 368357 [details] [review]
mapMarker: Bind properties from MapView

Instead of directly connecting to notify on properties of the
MapView instead bind these properties to the marker instance
and connect to those properties to avoid firing signal callbacks
acting on an already finallized marker instance.
Comment 3 Marcus Lundblad 2018-02-14 22:02:26 UTC
Created attachment 368358 [details] [review]
turnPointMarker: Avoid signal callback on finallized instance

Avoid running the animation complete callback on a finallized
instance by capturing the needed variables (latitude and longitude)
in the local scope.
Comment 4 Marcus Lundblad 2018-02-14 22:02:48 UTC
Created attachment 368359 [details] [review]
userLocationMarker: Use bound view properties

Instead of manually disconnecting view signal handlers,
connect to the bound properties.
Comment 5 Marcus Lundblad 2018-02-14 22:03:26 UTC
Attachment 368356 [details] pushed as c0502ef - mapView: Invalidate current turn point marker when removed
Attachment 368357 [details] pushed as a1aca45 - mapMarker: Bind properties from MapView
Attachment 368358 [details] pushed as 8374cd6 - turnPointMarker: Avoid signal callback on finallized instance
Attachment 368359 [details] pushed as f5655b7 - userLocationMarker: Use bound view properties