[gnome-maps] Do not destroy marker from signal handler
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] Do not destroy marker from signal handler
- Date: Sun, 14 Sep 2014 13:46:26 +0000 (UTC)
commit 31adccf12d6a33f245c1fefe885e917b35385065
Author: Jonas Danielsson <jonas threetimestwo org>
Date: Fri Sep 12 20:36:11 2014 +0200
Do not destroy marker from signal handler
This tries to prevent a segfault seen when calling destroy
in a signal handler. Instead destroy and re-create the marker
when showing a turnPointMarker.
https://bugzilla.gnome.org/show_bug.cgi?id=736583
src/mapView.js | 11 +++++++----
src/turnPointMarker.js | 13 -------------
2 files changed, 7 insertions(+), 17 deletions(-)
---
diff --git a/src/mapView.js b/src/mapView.js
index f87c438..f500a37 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -193,10 +193,13 @@ const MapView = new Lang.Class({
},
showTurnPoint: function(turnPoint) {
- let instructionMarker = new TurnPointMarker.InstructionMarker({ turnPoint: turnPoint,
- mapView: this });
- this._instructionMarkerLayer.add_marker(instructionMarker);
- instructionMarker.goToAndSelect(false);
+ if (this._turnPointMarker)
+ this._turnPointMarker.destroy();
+
+ this._turnPointMarker = new TurnPointMarker.TurnPointMarker({ turnPoint: turnPoint,
+ mapView: this });
+ this._instructionMarkerLayer.add_marker(this._turnPointMarker);
+ this._turnPointMarker.goToAndSelect(false);
},
showSearchResult: function(place) {
diff --git a/src/turnPointMarker.js b/src/turnPointMarker.js
index 40aa793..7def415 100644
--- a/src/turnPointMarker.js
+++ b/src/turnPointMarker.js
@@ -76,19 +76,6 @@ const TurnPointMarker = new Lang.Class({
}
});
-const InstructionMarker = new Lang.Class({
- Name: 'InstructionMarker',
- Extends: TurnPointMarker,
-
- _init: function(params) {
- this.parent(params);
-
- this.bubble.connect_after('closed', (function() {
- this.destroy();
- }).bind(this));
- }
-});
-
const DestinationMarker = new Lang.Class({
Name: 'DestinationMarker',
Extends: TurnPointMarker,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]