filter::python3: do not break converter/decoder
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 12 Dec 2023 10:28:41 +0000 (19:28 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 19 Dec 2023 04:19:18 +0000 (13:19 +0900)
A python-global reference counter is required for py-finalize.
This is workaround before applying such a global reference counter.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
ext/nnstreamer/tensor_filter/tensor_filter_python3.cc

index d27d7b2..3611893 100644 (file)
@@ -858,7 +858,17 @@ fini_filter_py (void)
   PyEval_RestoreThread (st);
   nnstreamer_filter_exit (NNS_support_python.v0.name);
 
+/**
+ * @todo Remove below lines after this issue is addressed.
+ * Tizen issues: After python version has been upgraded from 3.9.1 to 3.9.10,
+ * python converter is stopped at Py_Finalize. Since Py_Initialize is not called
+ * twice from this object, Py_Finalize is temporarily removed.
+ * We do not know if it's safe to call this at this point.
+ * We can finalize when ALL python subplugins share the same ref counter.
+ */
+#if 0
   /** Python should be initialized and finalized only once */
   if (Py_IsInitialized ())
     Py_Finalize ();
+#endif
 }