473,320 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Releasing Classes

Hi,

I've a separated class DOIT with a function WATCH which is
dynamically creating FileSystemWatchers.

In an other project I'm creating a new instance of DOIT
and start my function WATCH. So far so good....

I'm setting the Instance DOIT later in the application to
NOTHING, but all created FileSystemWatchers are still
running. How can I release/dispose a whole instanced class
within a project ? Or how can I kill all
FileSystemWatchers at one time (but I d'ont know how many
there are) ?

Many thanks for any help !
Cheers,
Dominic
Jul 21 '05 #1
1 1075
Dominic,
I would have the DOIT class implement the IDisposable interface. Instead of
setting the DOIT variable to Nothing, I would call the DOIT.Dispose method.
Within the Dispose method I would have it "shut down" each of the
FileSystemWatchers, that this instance of the DOIT class created earlier.

This may mean that DOIT would need an internal ArrayList to hold each
instance of any dynamically created FileSystemWatchers that were created.

Hope this helps
Jay

"Dominic" <do************@first-solution.com> wrote in message
news:02****************************@phx.gbl...
Hi,

I've a separated class DOIT with a function WATCH which is
dynamically creating FileSystemWatchers.

In an other project I'm creating a new instance of DOIT
and start my function WATCH. So far so good....

I'm setting the Instance DOIT later in the application to
NOTHING, but all created FileSystemWatchers are still
running. How can I release/dispose a whole instanced class
within a project ? Or how can I kill all
FileSystemWatchers at one time (but I d'ont know how many
there are) ?

Many thanks for any help !
Cheers,
Dominic

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: lebo | last post by:
Hi I'm trying to understand how Python handles memory usage and dynamic object loading and unloading. Problem to solve? Build a very low memory footprint (non-GUI) Python application for...
31
by: poisondart | last post by:
Hi, I'm not sure if this is the right group to post this. If not, then I would appreciate if somebody could point me to the correct group. This is my first time releasing software to the...
2
by: sausage31 | last post by:
I'm exporting some data to excel but am having trouble getting Access to 'release' Excel. What i want to achieve is to open excel, export some data then leave excel open so that the user can...
18
by: lylefair | last post by:
Can you post code, or a reference to a md? or ad? file on a website, where object variables are not released when they go out of scope and cause a problem, (but causing a problem is extraneous to...
8
by: One Handed Man [ OHM# ] | last post by:
Scenario. PDA connecting to a web service method using a reference on XP professional ( IIS ). XP limited to 10 sessions. How can the session be released once the method has finished. IE to log...
7
by: trialproduct2004 | last post by:
Hi all I am having application in c# where i am loading one table of database into dataset. My table is of large size. so whenever i am loading that into dataset my memory size is getting...
2
by: M.Ob | last post by:
Hello... I am having issues with my asp.net apps not releasing memory. The memory usage for the process w3p.exe continues to grow to it's allowable limit and does not drop until the app pool is...
1
by: gb | last post by:
I've written a Windows Service program that monitors a directory using the FileSystemWatcher class. The monitoring is done on it's own thread. Once a particular files gets added(created) to the...
0
by: gb | last post by:
I have a Windows Service program that monitors a directory. Once a file is added(created) to the directory, it calls code to process that file. Below is a summarized version of the code 1. ...
3
by: ssylee | last post by:
For example, I have a BITMAPINFO* and a BYTE* object to release the resources. Would the most bulletproof way of doing so involve checking to see if they are null, then if they are not, invoke a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.