Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 13th, 2004, 10:35 AM   #1
MARIO
Newbie
 
Join Date: Jun 2004
Posts: 1
Rep Power: 0 MARIO is on a distinguished road
Good evening !


Who would help to indicate a possible problem that can be caused by the code sample, in the class below ??
How can you rewrite that code in order to solve that problem out ??


***************************

Class Individual
Private Sub Save( )
'Saves local data in a DataBase
End Sub

Sub Dispose( )
Save( )
End Sub

Protected Overrides Sub Finalize( )
Dispose( )
MyBase.Finalize( )
End Sub
End Class

****************


Thanks so much, & very very nice Sunday !


MARIO
MARIO is offline   Reply With Quote
Old Dec 13th, 2004, 2:19 AM   #2
Xyler
Newbie
 
Join Date: Sep 2004
Location: South Africa, Eastern Cape
Posts: 28
Rep Power: 0 Xyler is on a distinguished road
I think you need to make the following change to the last method, maybe. Because I think parents need to be called first before anything else is done when you overwrite
Protected Overrides Sub Finalize( ) 
 MyBase.Finalize( ) 
 Dispose( ) 
End Sub

Not a hundred percent sure about this, but I think that is how it works.
__________________
Be vewwy vewwy quiet. I'm hunting wuntime ewwors.
Xyler is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:07 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC