How to securely delete an ofThread subclass

I am making a class based on the on ofThread that runs a image processing filter. In the program I need to delete this classes dynamically, but the program crashes when I try this. I assume that the problem lies in not terminating the thread correctly.

waitForThread();
if(modifier){delete  modifier;}
if(filterSelection){delete      filterSelection;}
delete []   image;
delete []   ref;

the code is from the destructor of the subclass obj where I release the memory. The obj itself is stored as a pointer that is deleted by delete obj;