The uncommitted sketch dialog is shown for many editing tools in the UI when the tool is deactivated with an uncommitted sketch in the map.
Custom MapTools will not show this dialog by default and the sketch will be discarded when the tool is deactivated.