From d4a4862e200c5cc05641199769c9bbfef66e9a3b Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 12 Jun 2008 09:49:31 +0000 Subject: Fixed uninitialized variables, including modified-since-save. (bzr r5897) --- src/document.cpp | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 333ce8d5a..af65d2d30 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -77,33 +77,30 @@ static gint doc_count = 0; static unsigned long next_serial = 0; -SPDocument::SPDocument() { - SPDocumentPrivate *p; - - keepalive = FALSE; - virgin = TRUE; - - modified_id = 0; - - rdoc = NULL; - rroot = NULL; - root = NULL; - style_cascade = cr_cascade_new(NULL, NULL, NULL); - - uri = NULL; - base = NULL; - name = NULL; - - _collection_queue = NULL; - - // Initialise instance of connector router. - router = new Avoid::Router(); +SPDocument::SPDocument() : + keepalive(FALSE), + virgin(TRUE), + modified_since_save(FALSE), + rdoc(0), + rroot(0), + root(0), + style_cascade(cr_cascade_new(NULL, NULL, NULL)), + uri(0), + base(0), + name(0), + priv(0), // reset in ctor + actionkey(0), + modified_id(0), + profileManager(0), // deferred until after other initialization + router(new Avoid::Router()), + perspectives(0), + current_persp3d(0), + _collection_queue(0) +{ // Don't use the Consolidate moves optimisation. router->ConsolidateMoves = false; - perspectives = NULL; - - p = new SPDocumentPrivate(); + SPDocumentPrivate *p = new SPDocumentPrivate(); p->serial = next_serial++; -- cgit v1.2.3