473,385 Members | 1,872 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,385 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 1077
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.