GNOME Bugzilla – Bug 793472
Using marker instances after finallized
Last modified: 2018-02-14 22:03:41 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 ==
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.
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.
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.
Created attachment 368359 [details] [review] userLocationMarker: Use bound view properties Instead of manually disconnecting view signal handlers, connect to the bound properties.
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