]> git.saurik.com Git - wxWidgets.git/commitdiff
assigning line marker to itself shouldn't invalidate it, add self-assignment check
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 14 Nov 2008 23:18:39 +0000 (23:18 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 14 Nov 2008 23:18:39 +0000 (23:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56770 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/stc/scintilla/src/LineMarker.h

index 3cb4139f08a2a4d5a0af8f8821f2eac729dafc12..24e22d905fcea6e28e2b85b8f25d9c293a74fa9f 100644 (file)
@@ -39,14 +39,16 @@ public:
        ~LineMarker() {
                delete pxpm;
        }
-       LineMarker &operator=(const LineMarker &) {
+       LineMarker &operator=(const LineMarker &other) {
                // Defined to avoid pxpm being blindly copied, not as real assignment operator
-               markType = SC_MARK_CIRCLE;
-               fore = ColourDesired(0,0,0);
-               back = ColourDesired(0xff,0xff,0xff);
-               alpha = SC_ALPHA_NOALPHA;
-               delete pxpm;
-               pxpm = NULL;
+               if ( &other != this ) {
+                       markType = SC_MARK_CIRCLE;
+                       fore = ColourDesired(0,0,0);
+                       back = ColourDesired(0xff,0xff,0xff);
+                       alpha = SC_ALPHA_NOALPHA;
+                       delete pxpm;
+                       pxpm = NULL;
+               }
                return *this;
        }
        void RefreshColourPalette(Palette &pal, bool want);