[Kst] extragear/graphics/kst/kst
George Staikos
staikos at kde.org
Mon Sep 12 14:33:54 CEST 2005
SVN commit 459906 by staikos:
fix memory leak: circular SharedPtr references caused toplevel views to never
be destroyed.
M +0 -1 kstgfxmousehandler.cpp
M +2 -1 kstgfxmousehandler.h
M +1 -1 kstgfxpicturemousehandler.cpp
M +1 -1 kstgfxtextmousehandler.cpp
--- trunk/extragear/graphics/kst/kst/kstgfxmousehandler.cpp #459905:459906
@@ -31,7 +31,6 @@
KstGfxMouseHandler::~KstGfxMouseHandler() {
-
}
--- trunk/extragear/graphics/kst/kst/kstgfxmousehandler.h #459905:459906
@@ -18,6 +18,7 @@
#ifndef KSTGFXMOUSEHANDLER_H
#define KSTGFXMOUSEHANDLER_H
+#include <qguardedptr.h>
#include "kstobject.h"
class KstTopLevelView;
@@ -44,7 +45,7 @@
// copy defaults to newObj
void copyDefaults(KstViewObjectPtr newObj);
- KstTopLevelViewPtr _top;
+ QGuardedPtr<KstTopLevelView> _top;
KstViewObjectPtr _defaultObject;
QPoint _mouseOrigin;
bool _mouseMoved;
--- trunk/extragear/graphics/kst/kst/kstgfxpicturemousehandler.cpp #459905:459906
@@ -77,7 +77,7 @@
pic->move(_prevBand.topLeft());
pic->resize(_prevBand.size());
_top->appendChild(KstViewObjectPtr(pic));
- KstApp::inst()->showEditViewObjectDialog(KstViewObjectPtr(pic), _top);
+ KstApp::inst()->showEditViewObjectDialog(KstViewObjectPtr(pic), KstTopLevelViewPtr(_top));
KstApp::inst()->document()->setModified();
}
_prevBand = QRect(-1,-1, 0, 0);
--- trunk/extragear/graphics/kst/kst/kstgfxtextmousehandler.cpp #459905:459906
@@ -82,7 +82,7 @@
_top->appendChild(KstViewObjectPtr(label));
label->move(_prevBand.topLeft());
label->resize(_prevBand.size());
- KstApp::inst()->showEditViewObjectDialog(KstViewObjectPtr(label), _top);
+ KstApp::inst()->showEditViewObjectDialog(KstViewObjectPtr(label), KstTopLevelViewPtr(_top));
KstApp::inst()->document()->setModified();
}
_prevBand = QRect(-1, -1, 0, 0);
More information about the Kst
mailing list