DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Tue, 2017-04-25, 15:33

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon, 2016-01-11, 20:00 
Offline

Joined: Mon, 2009-02-23, 19:57
Posts: 292
Hi, I'm passing a DcmFileFormat instance to a shared libary function, but aparently it is getting corrupted after calling getDataset() from inside the function.

Here's the caller:

Code:
void* lhandle = dlopen("./libmylibrary.so", RTLD_NOW);

if (lhandle) {
  typedef void (* processDataset)(DcmFileFormat *);
  processDataset lprocessDset = (processDataset)dlsym(lhandle, "processDataset");
  if (!lprocessDset) {
     dlclose(lhandle);
     return;
  }
  lprocessDset(ff);
  dlclose(lhandle); // if I call dlclose(..) my app hangs
}


And here's my shared library function definition:

Code:
extern "C" {
  void processDataset(DcmFileFormat *ff)
  {
    OFString lModality;
    DcmDataset * dataset = ff->getDataset(); // here ff is getting corrupted
    dataset->findAndGetOFString(DCM_Modality, lModality);
    dataset->putAndInsertOFStringArray(DCM_AccessionNumber, '123');
  }
}


Do you see anything wrong in my code?.

Thanks in advance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group