Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - How to free memory after ExtractPageText?
  FAQ FAQ  Forum Search   Register Register  Login Login

How to free memory after ExtractPageText?

 Post Reply Post Reply
Author
Message
Simon Kemp View Drop Down
Beginner
Beginner


Joined: 17 Sep 12
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon Kemp Quote  Post ReplyReply Direct Link To This Post Topic: How to free memory after ExtractPageText?
    Posted: 17 Sep 12 at 8:55AM
Hello,

I'm using ExtractPageText from a clarion program - all works very well but I don't know how to release the memory taken-up by the returned string. Any clues on this? Wondering if I need to make an api call of some kind involving address of the string.

Thanks,
Simon

Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 17 Sep 12 at 4:10PM
Calling QP.LibraryVersion() should free that large buffer and return a much smaller buffer of 4 bytes.

The DLL always keeps the last string result from the DLL active and the easiest way to free it is to call the DLL again with a function such as LibraryVersion.  This method allows us much more flexibility when working with string buffers.

Andrew.


Back to Top
Simon Kemp View Drop Down
Beginner
Beginner


Joined: 17 Sep 12
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon Kemp Quote  Post ReplyReply Direct Link To This Post Posted: 17 Sep 12 at 4:36PM
That is making loads of sense. I'll try soonish and report back.

Should explain that from clarion I can't actually take a "cstring" (null terminated string) as a return value. The workround is to prototype that QuickPDF is returning a long, then reference that address as a cstring. It left me thinking that housekeeping had to happen from my side - dumb of me. And now realise I have to be careful to finish working with my 'pretend cstring' before asking QuickPDF to do anything else.

Thank-you.
Back to Top
Simon Kemp View Drop Down
Beginner
Beginner


Joined: 17 Sep 12
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon Kemp Quote  Post ReplyReply Direct Link To This Post Posted: 18 Sep 12 at 6:36AM
Confirmed that quickpdf is tidying-up correctly. My memory leak must be somewhere else...

Thanks for the help,
Simon
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store