Clean up source unreferencing

This commit is contained in:
Alexander Kojevnikov 2010-05-07 22:15:11 +10:00
parent eea3100610
commit 79e048637f
2 changed files with 1 additions and 8 deletions

View File

@ -25,6 +25,7 @@ namespace Spek {
}
public void stop () {
// Need to manually remove the bus watch, otherwise `this` is never unreferenced.
if (watch_id > 0) {
GLib.Source.remove (watch_id);
watch_id = 0;
@ -33,13 +34,6 @@ namespace Spek {
pipeline.set_state (State.NULL);
pipeline = null;
}
spectrum = null;
pad = null;
}
~Source () {
stop ();
stdout.printf ("unref\n");
}
construct {

View File

@ -24,7 +24,6 @@ namespace Spek {
this.image = new ImageSurface (Format.RGB24, allocation.width, allocation.height);
if (this.source != null) {
this.source.stop ();
this.source = null;
}
this.source = new Source (
file_name, allocation.height, allocation.width,