Deepstream hangs. Can not add and delete source when turn on qos sink.

Hello,

I run deepstream app and want to set qos sink to TRUE;

But when I restart stream by delete and add it again. The deepstream was hangs on after have bellow log?

GStreamer-CRITICAL **: 07:48:15.902: 
Trying to dispose element src_sub_bin1, but it is in PLAYING instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.

Please help me, Thank you.

Seems you are implementing runtime add or delete streams, we have samples for this, you can refer to this,
sources/apps/sample_apps/deepstream_reference_apps/runtime_source_add_delete/