I have been debugging a multi-threaded application for a while now.

Recently I had been getting Heap corruption breakpoints from VS .net and had been trying to locate the source.

I found the source in a widget that deleted another widget directly. Apparently some part of the code was still pointing to it after i deleted it. (It wasn't any of my written code, but it may have been Qt or MS generated)

Anyway, on a hunch i tried deleteLater for the sub-widget, and it worked like a charm. (No more heap corruption errors at any rate)

I am wondering if there is any reason deleting a widget directly is bad in a multi-threaded application?

(Can't post any of my code as it does not belong to me. It belongs to my company)