Question about Object.destroy

ponce via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 20 10:52:14 PDT 2015


On Sunday, 20 September 2015 at 17:43:01 UTC, Lambert Duijst 
wrote:
>
> Is it because:
>
>  - The GC did decide to run and cleanup memory straight after 
> the call to s.destroy()
>  - An object being in an invalid state means the program 
> segfaults when the object is used ?
>  - Another reason..

All methods are virtual by default.
My guess would be that the invalid state implies that the virtual 
table pointer is not valid anymore, hence the crash.




More information about the Digitalmars-d-learn mailing list