summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pn_ns.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/pn_ns.c b/pn_ns.c
index 1a91acc..0a44c31 100644
--- a/pn_ns.c
+++ b/pn_ns.c
@@ -7,6 +7,7 @@ static void *parent_class;
struct pn_ns_priv {
struct pn_session *session;
+ gulong open_sig_handler;
};
enum {
@@ -29,6 +30,12 @@ pn_ns_free(struct pn_ns *ns)
g_object_unref(ns);
}
+static void
+open_cb(struct pn_ns *self)
+{
+ /* stub */
+}
+
/* GObject stuff */
static void
@@ -39,6 +46,8 @@ instance_init(GTypeInstance *instance,
struct pn_ns_priv *priv = self->priv;
self->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE(instance, PN_NS_TYPE, struct pn_ns_priv);
+
+ priv->open_sig_handler = g_signal_connect(self, "open", G_CALLBACK(open_cb), NULL);
}
static void
@@ -78,11 +87,25 @@ set_property(GObject *object,
}
static void
+dispose(GObject *obj)
+{
+ struct pn_ns *self = PN_NS(obj);
+ struct pn_ns_priv *priv = self->priv;
+
+ if (priv->open_sig_handler) {
+ g_signal_handler_disconnect(self, priv->open_sig_handler);
+ priv->open_sig_handler = 0;
+ }
+ G_OBJECT_CLASS(parent_class)->dispose(obj);
+}
+
+static void
class_init(void *g_class,
void *class_data)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(g_class);
+ gobject_class->dispose = dispose;
gobject_class->get_property = get_property;
gobject_class->set_property = set_property;