From 7b1b14913ac759e86176d212afa6d90f67eb8bb6 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sat, 5 Nov 2011 08:20:36 +0100 Subject: Various fixes: initialization, memory leak, wrong iterator usage (bzr r10721) --- src/dom/views.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/dom') diff --git a/src/dom/views.h b/src/dom/views.h index 48afd5d16..f165d2a9b 100644 --- a/src/dom/views.h +++ b/src/dom/views.h @@ -125,12 +125,14 @@ public: private: void assign(const AbstractView &other) + { + if (documentView != NULL) { + free(documentView); //NOTE: is free the correct method? + } documentView = other.documentView; - } - - DocumentView *documentView; - + } + DocumentView *documentView; }; @@ -163,7 +165,7 @@ public: /** * */ - DocumentView() {} + DocumentView() {defaultView = NULL;} /** * @@ -190,10 +192,13 @@ public: private: void assign(const DocumentView &other) + { + if (defaultView != NULL) { + free(defaultView); //NOTE: is free the correct method? + } defaultView = other.defaultView; - } - + } AbstractView *defaultView; }; -- cgit v1.2.3