diff --git a/source/gui/widgets/button.cpp b/source/gui/widgets/button.cpp index d407f0eb..eae1923e 100644 --- a/source/gui/widgets/button.cpp +++ b/source/gui/widgets/button.cpp @@ -379,7 +379,15 @@ namespace nana{ namespace drawerbase void trigger::icon(const nana::paint::image& img) { - if(img.empty()) return; + if(img.empty()) + { + if(attr_.icon) + { + delete attr_.icon; + attr_.icon = 0; + } + return; + } if(nullptr == attr_.icon) attr_.icon = new paint::image;