[Uml-devel] Small diff: explicit delete QCanvas in destructor of UMLView

Achim Spangler Achim.Spangler at mnet-online.de
Wed Jul 14 02:29:11 UTC 2004


Hi,
I have to change my patch, as the current execution of the UMLView destructor 
causes an implicit deletion of the previously contained widgets, which _can_ 
then cause a core dump of umbrello ( not for some small projects ).

Fix:
First delete explicitly all widgets in the destructor of the containing 
UMLView.
Then delete the QCanvas.

Speed this process - hopefully - by explicit deactivation of signal handling
==> avoid needless display/layout update activities for each deleted widget
 ( QObject::blockSignals( true ) ):
+ during UMLView::removeAllWidgets() ( reactivate signals afterwards )
+ during UMLView::~UMLView()

Please apply the attached patch.

Bye,
Achim
Am Dienstag, 13. Juli 2004 13:38 schrieb Achim Spangler:
> Hi,
> I forgot a small patch, I created locally during my X11 memory problem
> tracking.
>
> The documentation of Qt states for QCanvasView::~QCanvasView ()
> ---------
> Destroys the canvas view. The associated canvas is not deleted.
> ---------
>
> ==> thus we should delete the QCanvas of a UMLView instance during its
> destructor.
>
> This is implemented by the attached small patch.
>
> This solves no crash - but probably one of the existing memory holes. At
> least it's better to do jobs which are suggested by the doc ... ;-)
>
> Bye,
> Achim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SaveDeleteOfCanvas.diff
Type: text/x-diff
Size: 2421 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/umbrello-devel/attachments/20040714/397e8ae9/attachment.bin>


More information about the umbrello-devel mailing list