The Target and ImageButton classes needed their destructors to be virtual. While I didn't see any places in the code base where having these base classes' destructors non-virtual caused a memory leak, it could have caused one in the future.
Attached patch contains the fixes.