mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
openni2src: Add proper clean up of OpenNI2 objects
https://bugzilla.gnome.org/show_bug.cgi?id=732535
This commit is contained in:
parent
46a7f258a1
commit
652f0b4fd2
1 changed files with 13 additions and 4 deletions
|
@ -219,13 +219,11 @@ gst_openni2_src_finalize (GObject * gobject)
|
|||
}
|
||||
|
||||
if (ni2src->depth) {
|
||||
ni2src->depth->destroy ();
|
||||
delete ni2src->depth;
|
||||
ni2src->depth = NULL;
|
||||
}
|
||||
|
||||
if (ni2src->color) {
|
||||
ni2src->color->destroy ();
|
||||
delete ni2src->color;
|
||||
ni2src->color = NULL;
|
||||
}
|
||||
|
@ -333,10 +331,21 @@ gst_openni2_src_stop (GstBaseSrc * bsrc)
|
|||
{
|
||||
GstOpenni2Src *src = GST_OPENNI2_SRC (bsrc);
|
||||
|
||||
if (src->depth->isValid ())
|
||||
if (src->depthFrame)
|
||||
src->depthFrame->release ();
|
||||
|
||||
if (src->colorFrame)
|
||||
src->colorFrame->release ();
|
||||
|
||||
if (src->depth->isValid ()) {
|
||||
src->depth->stop ();
|
||||
if (src->color->isValid ())
|
||||
src->depth->destroy ();
|
||||
}
|
||||
|
||||
if (src->color->isValid ()) {
|
||||
src->color->stop ();
|
||||
src->color->destroy ();
|
||||
}
|
||||
|
||||
src->device->close ();
|
||||
|
||||
|
|
Loading…
Reference in a new issue