[gnome-contacts] Contact: Make keep_widget_uptodate callback owned
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Contact: Make keep_widget_uptodate callback owned
- Date: Wed, 12 Jun 2013 09:16:05 +0000 (UTC)
commit 1685c6a7a0937b82ead2a3e2d7c71facb8a0107e
Author: Alexander Larsson <alexl redhat com>
Date: Wed Jun 12 11:10:28 2013 +0200
Contact: Make keep_widget_uptodate callback owned
Without this the callback data will not get reffed when this is called
so it may later point to uninitialized memory. This happened to me
when deleting a contact and then undoing that, since ContactSheet.update()
had exited so the closure was freed but the keep_uptodate stuff
still referenced it.
src/contacts-contact.vala | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala
index f7f48ad..48c5197 100644
--- a/src/contacts-contact.vala
+++ b/src/contacts-contact.vala
@@ -1432,7 +1432,7 @@ public class Contacts.Contact : GLib.Object {
}
}
- public void keep_widget_uptodate (Widget w, Gtk.Callback callback) {
+ public void keep_widget_uptodate (Widget w, owned Gtk.Callback callback) {
callback(w);
ulong id = this.changed.connect ( () => { callback(w); });
w.destroy.connect (() => { this.disconnect (id); });
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]