[Uml-devel] Why returns UMLWidget::getFontMetrics a reference?

Sebastian Stein seb_stein at gmx.de
Tue Jul 13 11:40:12 UTC 2004


QFontMetrics &UMLWidget::getFontMetrics(UMLWidget::FontType fontType) {

returns a reference. I don't see a point in Umbrello's source, where a
function changes this returned value. Also, it seems to be design flaw. I
think if I change it into just returning a normal object, I can fix another
leak:

==32084== 36 bytes in 3 blocks are definitely lost in loss record 100 of 212
==32084==    at 0x3C01D54C: operator new(unsigned) (vg_replace_malloc.c:107)
==32084==    by 0x819A153: UMLWidget::setFontMetrics(UMLWidget::FontType, QFontMetrics) (umlwidget.cpp:1036)
==32084==    by 0x8199FB3: UMLWidget::setDefaultFontMetrics(UMLWidget::FontType) (umlwidget.cpp:972)
==32084==    by 0x819A29F: UMLWidget::forceUpdateFontMetrics(QPainter*) (umlwidget.cpp:1051)

Does anybody know, if this will create any conflicts? (besides changing many
lines of code)

Sebastian
-- 
http://www.hpfsc.de/ - die Seite rund um:
Assembler, Bundeswehr, TFT LCDs, Halle/Saale, Fahrradtouren, Neuseeland,
Wanderstaat Mauma, Raumschiff USS Nathan, Enemy Room, MLCAD Tutorial




More information about the umbrello-devel mailing list