indikad
asked on
Is it safe to kill the class instance and recreate another within an event in the instance itself? C# .Net
Is it safe to kill the class instance and recreate another within an event in the instance itself?
for example:
I have a class class1
Then in the Main method i instantiate it
class1 MyClass = new class1;
then witin a event procedure inside class1 I want to do this below.
this = null;
MyClass2 = new class1;
// MyClass2 is a ref variable that was passed in .
is this kind of thing safe in C#?
what consequences can I expect?
for example:
I have a class class1
Then in the Main method i instantiate it
class1 MyClass = new class1;
then witin a event procedure inside class1 I want to do this below.
this = null;
MyClass2 = new class1;
// MyClass2 is a ref variable that was passed in .
is this kind of thing safe in C#?
what consequences can I expect?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER