It seems that TBN_DELETINGBUTTON isn't called when the toolbar gets destroyed so the only way to avoid leaking the data is emptying it ourselves.