Skip to content

Commit 2cb955e

Browse files
authored
Merge pull request #1208 from zecakeh/action-map-weak
gio: Use weak reference to ActionMap when adding action entries
2 parents 90f24bd + 133f383 commit 2cb955e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gio/src/action_map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ pub trait ActionMapExtManual: sealed::Sealed + IsA<ActionMap> {
2020
};
2121
let action_map = self.as_ref();
2222
if let Some(callback) = entry.activate {
23-
action.connect_activate(clone!(@strong action_map => move |action, state| {
23+
action.connect_activate(clone!(@weak action_map => move |action, state| {
2424
// safe to unwrap as O: IsA<ActionMap>
2525
callback(action_map.downcast_ref::<Self>().unwrap(), action, state);
2626
}));
2727
}
2828
if let Some(callback) = entry.change_state {
29-
action.connect_change_state(clone!(@strong action_map => move |action, state| {
29+
action.connect_change_state(clone!(@weak action_map => move |action, state| {
3030
// safe to unwrap as O: IsA<ActionMap>
3131
callback(action_map.downcast_ref::<Self>().unwrap(), action, state);
3232
}));

0 commit comments

Comments
 (0)