buffer (ops): follow up commit, using gegl_buffer_signal_connect

This way of doing it is ugly - it might be that reimplementing a custom list
of callbacks instead of using gobject signals would be better.
parent 7d148871
......@@ -102,10 +102,11 @@ my_set_property (GObject *gobject,
// Invariant: valid buffer should always have valid signal handler
g_assert(p->buffer_changed_handler > 0);
g_signal_handler_disconnect (o->buffer, p->buffer_changed_handler);
/* XXX: should decrement signal connected count */
}
buffer = G_OBJECT (g_value_get_object (value));
if (buffer) {
p->buffer_changed_handler = g_signal_connect (buffer, "changed", G_CALLBACK(buffer_changed), operation);
p->buffer_changed_handler = gegl_buffer_signal_connect (buffer, "changed", G_CALLBACK(buffer_changed), operation);
}
break;
default:
......@@ -155,6 +156,7 @@ dispose (GObject *object)
// Invariant: valid buffer should always have valid signal handler
g_assert(p->buffer_changed_handler > 0);
g_signal_handler_disconnect (o->buffer, p->buffer_changed_handler);
/* XXX: should decrement signal connected count */
g_object_unref (o->buffer);
o->buffer = NULL;
}
......
......@@ -50,8 +50,8 @@ static GeglBuffer *ensure_buffer (GeglOperation *operation)
buffer = gegl_buffer_open (o->path);
o->user_data = buffer;
}
g_signal_connect (buffer, "changed",
G_CALLBACK(buffer_changed), operation);
gegl_buffer_signal_connect (buffer, "changed",
G_CALLBACK(buffer_changed), operation);
return buffer;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment