J
Jeff
In C++ I used to declare the following macro for deleteing objects:
#define SAFEDELETE(x) if(x != NULL) { delete x; x = NULL; }
Is there currently a way to do something similar to this in C#?
I'm constantly writing...
if(x != null)
{
x.Dispose();
x = null;
}
and would love to just write something like...
SAFEDISPOSE(x);
Thanks for your help!
#define SAFEDELETE(x) if(x != NULL) { delete x; x = NULL; }
Is there currently a way to do something similar to this in C#?
I'm constantly writing...
if(x != null)
{
x.Dispose();
x = null;
}
and would love to just write something like...
SAFEDISPOSE(x);
Thanks for your help!