Yannick has a good point. Also try to set a breakpoint into your Cleanup() method (if you have one) to see if exception originates from there.
Before recompiling/reloading your plugin also try resetting the scene. Its possible that a reference of your object is still in there and there's a conflict.
Marsel Khadiyev (Software Developer, EPHERE Inc.)