I don't get it. If _ref.deref != 0 QThreadData::deref should call "delete this", which seems to be what you want?
Which tool are you using to check for memory leaks? Do you compile without optimization? Compile with (aggressive) optimization may give false results.
If you still have problems, maybe you could supply a small program which exactly demonstrates the problem.
Bookmarks