[fpc-devel] freeing a (olestr?) pwidechar

Marco van de Voort fpc at pascalprogramming.org
Sun Jun 1 19:09:10 CEST 2025


I'm looking into 
https://gitlab.com/freepascal.org/fpc/source/-/issues/41235

by  porting code from comobj.DispatchInvoke to variants.  However I need 
to deallocate a pwidechar allocated with StringToOleStr.

Comobj does with sysfreestring, which is the winapi widestring 
deallocation, and I can't quickly find a more portable example. Is there 
a construct to do this somewhat portable, like e.g.

pwidestring(theptr)^:=nil;

or do we miss a generic opposite to StringToOleStr here?



More information about the fpc-devel mailing list