aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2002-11-21 08:50:39 +0000
committernyamatongwe <devnull@localhost>2002-11-21 08:50:39 +0000
commit9c1aec0b3112dd01a5dc3b0a03fcf40926ecded9 (patch)
tree044d5cd5706aef0b54c42c934ed3d518708a9ceb /src
parentf3b8b19acf2b70389a050180f67698802dcb13b6 (diff)
downloadscintilla-mirror-9c1aec0b3112dd01a5dc3b0a03fcf40926ecded9.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);