Skip to content

Commit cb2750a

Browse files
committed
DragDropAction: Fix crash
1 parent 5c7fd36 commit cb2750a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/DragDropAction.vala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ namespace Gala {
145145
}
146146

147147
private void release_actor (Actor actor) {
148+
actor.weak_unref (actor_dispose_notify);
149+
148150
if (DragDropActionType.SOURCE in drag_type) {
149151

150152
var source_list = sources.@get (drag_id);
@@ -155,8 +157,6 @@ namespace Gala {
155157
var dest_list = destinations[drag_id];
156158
dest_list.remove (actor);
157159
}
158-
159-
actor.destroy.disconnect (release_actor);
160160
}
161161

162162
private void connect_actor (Actor actor) {
@@ -181,7 +181,11 @@ namespace Gala {
181181
dest_list.add (actor);
182182
}
183183

184-
actor.destroy.connect (release_actor);
184+
actor.weak_ref (actor_dispose_notify);
185+
}
186+
187+
private void actor_dispose_notify (Object obj) {
188+
release_actor ((Clutter.Actor) obj);
185189
}
186190

187191
private void emit_crossed (Actor destination, bool is_hovered) {

0 commit comments

Comments
 (0)