[Lazarus] IUnknown and reference counting

Kostas Michalopoulos badsectoracula at gmail.com
Thu Mar 21 15:22:19 CET 2013


No, i never said that. I said that i have a problem with the way i'm using
memory in my code currently (which is the result of the code doing stuff i
didn't originally planned - in particular i didn't plan to have partial
lightmap calculations) and i want to redesign it. Previously i would do
either something like manual refcounting or use some sort of lightmap
manager that would take care of managing the memory.

What i'm thinking right now is to simply create the lightmap objects (as
interfaces) from the lightmapper side and send them to the 3D world side.
My only concern for now is if interfaces are thread safe (that is, what
happens if two threads keep a reference for the same object) or i need to
do my own locking.



On Thu, Mar 21, 2013 at 3:09 PM, Graeme Geldenhuys
<graeme at geldenhuys.co.uk>wrote:

> On 2013-03-21 12:55, Kostas Michalopoulos wrote:
> > properties. That could save a lot of headaches i have with my 3D world
> > editor's lightmap generation (currently there is some wrong memory
> > deallocation somewhere that crashes the editor in partial lightmap
>
>
> Don't be fooled to think Interfaces is the answer to all memory issues.
> The use of Interfaces is an "advanced topic". There are many pitfalls
> you need to look out for when using them.
>
>
> Regards,
>   - Graeme -
>
> --
> fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
> http://fpgui.sourceforge.net/
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130321/24d2e98b/attachment-0003.html>


More information about the Lazarus mailing list