Hello,
I tried out JNA with one of our DLLs and it worked pretty well. Thanks for the
good work.
However, I was wondering under which conditions JNA objects like Structure or
primitive arrays take ownership of a block of native memory and consequently
free that block of memory when GCed.
I could find this mail thread in the archives :
<https://jna.dev.java.net/servlets/ReadMsg?listName=users&msgNo=1777>
https://jna.dev.java.net/servlets/ReadMsg?listName=users&msgNo=1777
That still does not fully answer my questions:
- Does JNA free memory returned by functions (e.g. MyStruct* getNewStruct() )?
- How does it work with Struct* arguments passed into a Callback? Does JNA
assume that this memory will be freed by the caller?
- How are the assumptions in general about who is responsible for freeing which
memory?
With best regards,
Wolfgang Buckel
Siemens AG
Industry Sector
Mobility Division
Traffic Solutions
Research & Development
I MO TS R&D SE
Hofmannstr. 51
81379 Munich, Germany
Tel.: +49 (89) 722-22370
Fax: +49 (89) 722-44477
Mobile: +49 (172) 8421190
<mailto:wolf...@siemens.com> mailto:wolf...@siemens.com
Siemens Aktiengesellschaft: Chairman of the Supervisory Board: Gerhard Cromme;
Managing Board: Peter Loescher, Chairman, President and Chief Executive Officer;
Wolfgang Dehen, Heinrich Hiesinger, Joe Kaeser, Barbara Kux, Hermann Requardt,
Siegfried Russwurm, Peter Y. Solmssen; Registered offices: Berlin and Munich,
Germany; Commercial registries: Berlin Charlottenburg, HRB 12300, Munich, HRB
6684; WEEE-Reg.-No. DE 23691322
Important notice: This e-mail and any attachment thereof contain corporate
proprietary information. If you have received it by mistake, please notify us
immediately by reply e-mail and delete this e-mail and its attachments from your
system. Thank you.