Skip to main content
Participant
October 1, 2019
Question

Can I get away with not calling SXMPFiles::Terminate() and SXMPMeta::Terminate() ?

  • October 1, 2019
  • 0 replies
  • 176 views

I'm implementing a Windows property handler class for PDF files.  It uses the Adobe XMP SDK to read and write metadata to the PDFs.  When the property handler is initialized, it loads up the necessary XMP components by calling SXMPMeta::Initialize() and SXMPFiles::Initialize().

 

Now the XMP documentation says that when you're done using the toolkit, you should explicitly terminate the XMP components by calling SXMPFiles::Terminate() and SXMPMeta::Terminate().  So I put those function calls in my class's destructor.  I noticed, however, that those function calls cause Windows File Explorer to slightly hang when displaying PDFs.  I think they've also caused some random crashes as well.  When I exclude the calls, everything seems to work fine and fast.

 

So I was wondering if I can either get away with not calling those functions, or if there's perhaps a better place to put them outside of the class destructor.  For example, would it be feasible to place them in my implementation of DllCanUnloadNow?  Would placing them there properly terminate the XMP libraries?  Thank you for any guidance.

    This topic has been closed for replies.