I create a class for an image buffer. The class looks like this:
import ctypes
class ImgBuf():
def __init__(self, bufnr=ctypes.c_int(-1)):
self.bufnr = bufnr
The attribute 'bufnr' is handed over to a shared library by reference and changed for buffer management. I want to have multiple instances of this class (to manage several image buffers). In the small example
import imgBuf.ImgBuf
buf1 = dicamsdk.ImgBuf()
buf2 = dicamsdk.ImgBuf()
sharedDLL.allocateBuffer(buf1)
the bufNr
has been changed in the both instances. How can I make instances independent?