Breaking the debugger whenever delete/delete[] is called in C++

  • A+

I might be missing something very trivial but is there a way to pause/break the debugger whenever any delete or delete[] is called? I tried Debug->New Breakpoint->Function Breakpoint (typed in delete as the function name) but it doesn't really trigger.

Thanks in Advance!


delete and delete[] are operators in expressions, not functions.

They do however call operator functions that can be overloaded (and used to set breakpoint on). These are named operator delete and operator delete[].


:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: