Skip to content

Instantly share code, notes, and snippets.

@plioi
Created February 25, 2015 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plioi/c2b624dc864720fd1fc0 to your computer and use it in GitHub Desktop.
Save plioi/c2b624dc864720fd1fc0 to your computer and use it in GitHub Desktop.
public class NoSeriouslyDudeMarshalByRefObject : MarshalByRefObject, IDisposable
{
public override sealed object InitializeLifetimeService()
{
return null; //Prevent the object from being ruined after 6 or so minutes.
}
public void Dispose()
{
RemotingServices.Disconnect(this); //Avoid the memory leak otherwise introduced above.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment