Results 1 to 3 of 3

Thread: Suppressing Finializers?

Threaded View

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Suppressing Finializers?

    Does anyone if this can be done in Java? I have some resources that need to be cleaned up in a timely fashion and im having issues with the lag between when the object is no longer refrenced by the application and when the object is consumed by the GC. Ive been working with Visual Basic Net lately and ive found a way to suppress them.
    Code:
    Class Demo
      Private m_disposed As Boolean
     
      Public Sub Disposed()
    
      If(Not m_disposed) Then 
        Finialize()
        GC.SuppressFinialize(this)
        m_disposed = True
      End If
      End Sub 
    
      Protected Overides Sub Finialize()
      'perform any necessary clean up here
     End Sub 
    End Class
    Last edited by Dilenger4; Apr 17th, 2002 at 03:13 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width