when is the object destuctor called?

Tom S h3r3tic at remove.mat.uni.torun.pl
Mon May 22 15:51:09 PDT 2006


Johan Granberg wrote:
> Tom S wrote:
>> Derek Parnell wrote:
>>> I use the same technique. The idea that the only resource a ctor/dtor 
>>> manages is RAM is plainly short-sighted.
> Agrees.
>> As for the texture example, they should be freed by some sort of a 
>> manager anyway - they have to be released before the rendering device 
>> anyway...
> Ok I think I get it. The destructors should only bee used when objects 
> is deleted manually. right?

That's what I'm doing. Otherwise dtors are just unreliable...


>> - they have to be released before the rendering device anyway...
> Does this implies that the operating system does not reclaim video memory
> at program exit? I have assumed that was the case but the answers in 
> this thread left me uncertain.

 From my experience, not all OSes do that... I've seen a few crashes due 
to the GPU running out of texture memory ;D


-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d-pu s+: a-->----- C+++$>++++ UL P+ L+ E--- W++ N++ o? K? w++ !O 
!M V? PS- PE- Y PGP t 5 X? R tv-- b DI- D+ G e>+++ h>++ !r !y
------END GEEK CODE BLOCK------

Tomasz Stachowiak  /+ a.k.a. h3r3tic +/



More information about the Digitalmars-d mailing list