www.digitalmars.com         C & C++   DMDScript  

D - GC AV

reply Vathix <vathix dprogramming.com> writes:
Every once in awhile the function std.gc.fullCollect causes an access 
violation. Could it be caused by a deleted object's pointer still being 
stored at an int (could be there by chance even), and the GC thinking 
it's the actual object and it attempts to scan it? If so, couldn't this 
occur when the GC kicks in automatically? This could be a big problem. 
Perhaps the GC should always be wrapped in try/catch and ignore the 
exception. I can't think of any other solution.

-- 
Christopher E. Miller
www.dprogramming.com
Feb 03 2004
parent yaneurao <yaneurao_member pathlink.com> writes:
In article <bvoq3n$n2e$1 digitaldaemon.com>, Vathix says...
Every once in awhile the function std.gc.fullCollect causes an access 
violation. Could it be caused by a deleted object's pointer still being 
stored at an int (could be there by chance even), and the GC thinking 
it's the actual object and it attempts to scan it?

yes. but ..
 If so, couldn't this 
occur when the GC kicks in automatically? This could be a big problem. 
Perhaps the GC should always be wrapped in try/catch and ignore the 
exception. I can't think of any other solution.

no need to try/catch. GC scan only to the memory which GC itself allocated , so never happen AV. yaneurao.
Feb 03 2004