samples: Leave memory management up to the GC
This commit is contained in:
parent
27d42dfd3f
commit
c5216c0bc3
@ -24,12 +24,7 @@ namespace GstreamerSharp
|
|||||||
var msg = bus.TimedPopFiltered (Constants.CLOCK_TIME_NONE, MessageType.Eos | MessageType.Error);
|
var msg = bus.TimedPopFiltered (Constants.CLOCK_TIME_NONE, MessageType.Eos | MessageType.Error);
|
||||||
|
|
||||||
// Free resources
|
// Free resources
|
||||||
if (msg != null)
|
|
||||||
msg.Dispose ();
|
|
||||||
|
|
||||||
bus.Dispose ();
|
|
||||||
pipeline.SetState (State.Null);
|
pipeline.SetState (State.Null);
|
||||||
pipeline.Dispose ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -28,7 +28,6 @@ namespace GstreamerSharp
|
|||||||
// Build the pipeline
|
// Build the pipeline
|
||||||
pipeline.Add (source, sink);
|
pipeline.Add (source, sink);
|
||||||
if (!source.Link (sink)) {
|
if (!source.Link (sink)) {
|
||||||
pipeline.Dispose ();
|
|
||||||
Console.WriteLine ("Elements could not be linked");
|
Console.WriteLine ("Elements could not be linked");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -40,7 +39,6 @@ namespace GstreamerSharp
|
|||||||
var ret = pipeline.SetState(State.Playing);
|
var ret = pipeline.SetState(State.Playing);
|
||||||
if (ret == StateChangeReturn.Failure) {
|
if (ret == StateChangeReturn.Failure) {
|
||||||
Console.WriteLine ("Unable to set the pipeline to the playing state");
|
Console.WriteLine ("Unable to set the pipeline to the playing state");
|
||||||
pipeline.Dispose ();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,12 +64,9 @@ namespace GstreamerSharp
|
|||||||
Console.WriteLine ("Unexpected messag received");
|
Console.WriteLine ("Unexpected messag received");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
msg.Dispose ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bus.Dispose ();
|
|
||||||
pipeline.SetState (State.Null);
|
pipeline.SetState (State.Null);
|
||||||
pipeline.Dispose ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user