473,396 Members | 2,108 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,396 software developers and data experts.

Service Question

dot.net 2.0 c#

i have 2 Questions....easy one 1st
How to destroy a object within itself without calling dispose
example
namespace mytest
{
class someclass
{
private someobject;
public someclass(){
someobject = new someobject();
}
public void Destroy
{
someobject=null;
//code to set this = null
}
}
}
/// 2nd question
I have a windows service that starts a thread manager
example from onstart
public void OnStart()
//manager is a private field of the service
Manager=new ThreadManager()
//initthreads creates all the worker threads
if (Manager.InitThreads()==false)
{
this.stop() ;
}

//here is my question
should i run the manager on its own Thread or is the above ok...there is
a timer started and maintained when
Manager.InitThread() Runs....and all works just fine...?
Dec 28 '07 #1
1 1073
Hi,
"Analizer1" <dv*****@sbcglobal.netwrote in message
news:xd*************@newssvr11.news.prodigy.net...
dot.net 2.0 c#

i have 2 Questions....easy one 1st
How to destroy a object within itself without calling dispose
You cannot destroy an object from itself, an object is marked as collectable
when no references exist to it. Now you are calling Destroy from another
method, that calling method holds a reference to the instance, hence the
instance will not be destroyed. You can release any internal
references/resources you have. but you this probably will make the status of
the instance unknow
--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
Dec 28 '07 #2

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

Similar topics

1
by: Liza | last post by:
Hello, can you guys help me out here....? this is part of my masters degree and hence is very important to me..... my supervisor doesn't seem to be too interested in helping me and infact is...
2
by: Tom Simpson | last post by:
I have set up a Windows service in VB.NET, and created a 'Service Manager' Windows Forms app that can 'get' information from that service. The service consists of the basic service 'framework'...
2
by: John A | last post by:
I have a Web Service that I am reponsible for that we use for data integration purposes. Recently I have been tasked with sending some of this data to a third party. Because they need to receive...
2
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app...
2
by: =?Utf-8?B?bXVyYWRqYW1lcw==?= | last post by:
Yes, sorry I tried to make it clear in the original question that I want to get the user token of the service - ie. the account the service is running under. I know services don't have user tokens...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.