Jonathan M Davis wrote: >IIRC, class destructors aren't supposed to reference any references or >pointers to the heap. They're intended for cleaning up other >resources. I don't think that there are any guarantees with regards to >the order of the destruction of objects which are being garbage >collected. But I don't mess with destructors much, so I'm not all that >well versed in the details. > >- Jonathan M Davis
I think destructors shouldn't use references to the _garbage collected_ heap. Freeing resources which were allocated with malloc should work. In fact freeing C memory is the only usecase for destructors I can think of. If you rely on destructors to release file handles / gpu textures / other limited resources you risk to run out of those. -- Johannes Pfau
signature.asc
Description: PGP signature
