Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 27th, 2006, 07:12 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default A tricky question

Hi

Just a theoretical question, I have heard people say that destructor is not called with .net applications, its completely the role of garbage collector to destroy objects, is that true???

Regards
Mike
__________________
Regards
Mike
 
Old October 27th, 2006, 07:25 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

That is correct, destructors are invoked automatically and can not be called explicitly.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old October 27th, 2006, 07:39 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

No no

What I meant is that suppose I create a destructor on page and destroy some objects there, will those objects be destroyed or will the GC decide when to destroy those objects!!!!!

Regards
Mike
 
Old October 27th, 2006, 08:17 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I understand what you are saying; that is a, partly, false statement. If you declare a destructor the GC will call your destructor and destroy your objects. So it is the role of the GC to call your destructor, but the destructor is responsible for destorying your objects.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature





Similar Threads
Thread Thread Starter Forum Replies Last Post
Tricky Queries balesh.mind SQL Server 2005 5 April 12th, 2008 10:29 PM
Easy but tricky for me... :( Varg_88 Classic ASP Basics 3 January 13th, 2005 11:21 AM
Alright, here's a tricky one... Anubis Access VBA 14 November 19th, 2003 04:22 PM
Tricky SQL fastcorvette Access 2 October 10th, 2003 10:28 AM
Very tricky challenge 12th_Man SQL Language 3 June 20th, 2003 06:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.