One of the methods I wrapped is main in dcm2pnm.
I then changed it to stream in memory instead of reading/writing files.
However I cannot see where the DcmFileFormat instance is deleted.
I tried to add a delete line but it crashed so I assume something had already deleted it, but what?
Does the following
delete di;
delete disp;
Somehow also delete the DcmFileFormat object?
Note I now have the following code to pass in a buffer instead of file:
Code: Select all
DcmFileFormat *dfile = new DcmFileFormat();
DcmInputBufferStream dcmInputBufferStream;
dcmInputBufferStream.setBuffer(inputbuf.inputbuffer, inputbuf.length);
dcmInputBufferStream.setEos();
dfile->transferInit();
OFCondition cond = dfile->read(dcmInputBufferStream, opt_transferSyntax,
EGL_withoutGL, DCM_MaxReadLength);
dfile->transferEnd();