summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2016-01-01 20:14:46 +0100
committerSebastian Geerken <devnull@localhost>2016-01-01 20:14:46 +0100
commitbcf31f50c46dac457fe7f0fdd1f88331e07c9e60 (patch)
tree9e12f920cf6be2032bfead5b69e1d717ef62e1d6
parentdc6e85ba555ab76f0e13495955690875c8b1a8d4 (diff)
Fix memory problem.
-rw-r--r--dw/tools.cc10
-rw-r--r--dw/tools.hh4
2 files changed, 12 insertions, 2 deletions
diff --git a/dw/tools.cc b/dw/tools.cc
index 60e5e029..cb45ef15 100644
--- a/dw/tools.cc
+++ b/dw/tools.cc
@@ -20,7 +20,7 @@ SizeParams::SizeParams (int numPos, Widget **references, int *x, int *y)
debugPrint ();
}
-SizeParams::SizeParams (SizeParams &other)
+SizeParams::SizeParams (const SizeParams &other)
{
DBG_OBJ_CREATE ("dw::core::SizeParams");
init ();
@@ -34,6 +34,14 @@ SizeParams::~SizeParams ()
DBG_OBJ_DELETE ();
}
+SizeParams &SizeParams::operator=(const SizeParams &other)
+{
+ cleanup ();
+ init ();
+ fill (other.numPos, other.references, other.x, other.y);
+ debugPrint ();
+}
+
void SizeParams::init ()
{
numPos = 0;
diff --git a/dw/tools.hh b/dw/tools.hh
index 60435c5a..2f8ff0b5 100644
--- a/dw/tools.hh
+++ b/dw/tools.hh
@@ -39,9 +39,11 @@ private:
public:
SizeParams ();
SizeParams (int numPos, Widget **references, int *x, int *y);
- SizeParams (SizeParams &other);
+ SizeParams (const SizeParams &other);
~SizeParams ();
+ SizeParams &operator=(const SizeParams &other);
+
void fill (int numPos, Widget **references, int *x, int *y);
void forChild (Widget *parent, Widget *child, int xRel, int yRel,
SizeParams *childParams);