aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2002-11-21 08:50:39 +0000
committernyamatongwe <unknown>2002-11-21 08:50:39 +0000
commit6859a3450b1909c2f871318c61cd0a265149b4a9 (patch)
tree044d5cd5706aef0b54c42c934ed3d518708a9ceb /src
parent2f0873fcb2ed397d28e473f0263c1b5d309d2499 (diff)
downloadscintilla-mirror-6859a3450b1909c2f871318c61cd0a265149b4a9.tar.gz
Added copy constructor and operator= to avoid blind copy of XPM pointer
leading to problems when double freed.
Diffstat (limited to 'src')
-rw-r--r--src/LineMarker.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/LineMarker.h b/src/LineMarker.h
index 0ac4d3155..c75a31230 100644
--- a/src/LineMarker.h
+++ b/src/LineMarker.h
@@ -43,9 +43,24 @@ public:
back = ColourDesired(0xff,0xff,0xff);
pxpm = NULL;
}
+ LineMarker(const LineMarker &) {
+ // Defined to avoid pxpm being blindly copied, not as real copy constructor
+ markType = SC_MARK_CIRCLE;
+ fore = ColourDesired(0,0,0);
+ back = ColourDesired(0xff,0xff,0xff);
+ pxpm = NULL;
+ }
~LineMarker() {
delete pxpm;
}
+ LineMarker &operator=(const LineMarker &) {
+ // 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);
+ pxpm = NULL;
+ return *this;
+ }
void RefreshColourPalette(Palette &pal, bool want);
void SetXPM(const char *textForm);
void SetXPM(const char * const *linesForm);