diff --git a/common/include/gr.h b/common/include/gr.h index deadf5824..5456de894 100644 --- a/common/include/gr.h +++ b/common/include/gr.h @@ -261,10 +261,13 @@ public: } grs_main_bitmap &operator=(grs_main_bitmap &&r) { + if (this == &r) + return *this; + reset(); grs_bitmap::operator=(std::move(static_cast(r))); - bm_data = exchange(r.bm_data, nullptr); + r.bm_data = nullptr; #if DXX_USE_OGL - gltexture = exchange(r.gltexture, nullptr); + r.gltexture = nullptr; #endif return *this; }