[gnome-boxes] box-config: Don't use object from closure
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] box-config: Don't use object from closure
- Date: Tue, 4 Aug 2015 22:42:29 +0000 (UTC)
commit 078c98cd2c8540b19de479811dddbf8dddb4990c
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Tue May 12 17:51:50 2015 +0100
box-config: Don't use object from closure
Using the object in lambda from closure will add a ref on the object in
question and object will leak unless id of signal is saved and signal
handler is explicitly disconnected. Since signal handlers are passed the
source object, we can simply use that and avoid redundant ref.
https://bugzilla.gnome.org/show_bug.cgi?id=746800
src/box-config.vala | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/box-config.vala b/src/box-config.vala
index 4ca2754..f43f4ab 100644
--- a/src/box-config.vala
+++ b/src/box-config.vala
@@ -147,7 +147,7 @@ public class Boxes.BoxConfig: GLib.Object, Boxes.IConfig {
foreach (var prop in properties)
load_property (object, prop.name, prop.default_value);
- object.notify.connect ((pspec) => {
+ object.notify.connect ((object, pspec) => {
foreach (var prop in properties)
if (pspec.name == prop.name) {
save_property (object, pspec.name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]