TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
S Schearer
NA
3
0
How do I handle a situation that needs to destroy an object in C#?
Apr 6 2010 2:10 PM
I have a GUI that creates an object when the user hits the start button. In the object's initialization method other objects are created and processes are started.
If the object's initialization fails, I want to recreate the object. The object needs to be destroyed before it can be recreated because some processes are started in the initialization routine and they don't end until the object goes out of scope.
In C++ I would have just called the object's destructor.
Can someone please tell me how to solve this problem in C#?
I was told to just restart the program, but that seems hokey...
Reply
Answers (
2
)
Accept file via HTTP form?
How to find and replace double quotes?