@@ -2555,7 +2555,7 @@ appendVideoFrame(PyObject *obj, PyObject *args)
25552555
25562556 view = PyMemoryView_GET_BUFFER (memoryview );
25572557 unsigned char * buffer = (unsigned char * )(view -> buf );
2558-
2558+ Py_DECREF ( memoryview );
25592559#else
25602560
25612561 PyObject * ao = PyObject_GetAttrString (o , "__array_struct__" );
@@ -2577,7 +2577,7 @@ appendVideoFrame(PyObject *obj, PyObject *args)
25772577
25782578 // Get image information
25792579 unsigned char * buffer = (unsigned char * )pai -> data ; // The address of image data
2580-
2580+ Py_DECREF ( ao );
25812581#endif
25822582
25832583 int frameId = DBR_AppendFrame (self -> hBarcode , buffer );
@@ -2647,7 +2647,6 @@ static PyObject * UpdataRuntimeSettings(PyObject *obj, PyObject *args)
26472647 return NULL ;
26482648 }
26492649 PublicRuntimeSettings settings = CreateCRuntimeSettings (pyParameters );
2650- Py_DECREF (pyParameters );
26512650 char szErrorMsgBuffer [256 ];
26522651 int errorCode = DBR_UpdateRuntimeSettings (self -> hBarcode , & settings , szErrorMsgBuffer , 256 );
26532652 if (errorCode != 0 )
@@ -2847,6 +2846,7 @@ static PyObject * DecodeBuffer(PyObject *obj, PyObject *args)
28472846
28482847 view = PyMemoryView_GET_BUFFER (memoryview );
28492848 char * buffer = (char * )(view -> buf );
2849+
28502850 // nd = (int)(view->ndim);
28512851 // int len = (int)(view->len);
28522852 // int stride = (int)(view->strides[0]);
@@ -2873,6 +2873,7 @@ static PyObject * DecodeBuffer(PyObject *obj, PyObject *args)
28732873
28742874 // Get image information
28752875 char * buffer = (char * )pai -> data ; // The address of image data
2876+
28762877 // int width = (int)pai->shape[1]; // image width
28772878 // int height = (int)pai->shape[0]; // image height
28782879 // int channels = (int)pai->shape[2];
@@ -3153,6 +3154,7 @@ static PyObject * AppendVideoFrame(PyObject *obj, PyObject *args)
31533154
31543155 view = PyMemoryView_GET_BUFFER (memoryview );
31553156 unsigned char * buffer = (unsigned char * )view -> buf ;
3157+ Py_DECREF (memoryview );
31563158
31573159#else
31583160
@@ -3175,6 +3177,7 @@ static PyObject * AppendVideoFrame(PyObject *obj, PyObject *args)
31753177
31763178 // Get image information
31773179 unsigned char * buffer = (unsigned char * )pai -> data ; // The address of image data
3180+ Py_DECREF (ao );
31783181
31793182#endif
31803183
0 commit comments