Generic method to avoid server crash.

Is there a reason to wait 5 ms before disposing?