Deconstructor in multithread