Message ID | 20210909130733.25187-1-vedantparanjape160201@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp index dbdcaec0b111..7dcb3c5c2869 100644 --- a/test/gstreamer/gstreamer_test.cpp +++ b/test/gstreamer/gstreamer_test.cpp @@ -64,17 +64,16 @@ GstreamerTest::GstreamerTest() return; } + pipeline_ = nullptr; + libcameraSrc_ = nullptr; + status_ = TestPass; } GstreamerTest::~GstreamerTest() { - if (libcameraSrc_ && - !gst_object_has_as_ancestor(GST_OBJECT(libcameraSrc_), - GST_OBJECT(pipeline_))) - gst_object_unref(libcameraSrc_); - if (pipeline_) - gst_object_unref(pipeline_); + g_clear_object(&pipeline_); + g_clear_object(&libcameraSrc_); gst_deinit(); }