Bug 339278 - Crash when resizing class diagram display
Summary: Crash when resizing class diagram display
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.13.3
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-21 21:01 UTC by Mark Stanton
Modified: 2014-11-26 23:38 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.14.2


Attachments
Backtrace of crash (7.57 KB, text/plain)
2014-09-21 21:02 UTC, Mark Stanton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Stanton 2014-09-21 21:01:16 UTC
Umbrello autoloads the previous project, great. I have a couple of classes in the class diagram display, but it's too small to see so I use the zoom slider in the bottom right hand corner. The display doesn't resize and the app crashes.
I may have tried this before the project had fully loaded. Re-opening Umbrello (while writing this report) and waiting a while allows me to zoom the display that crashed before

Reproducible: Sometimes




The crash reporting assistant prepared everything for me but was unable to log in to this system, hence the manual report. 
I have a backtrace (courtesy the crash reporting assistant), but where/how do I upload it?
Comment 1 Mark Stanton 2014-09-21 21:02:02 UTC
Created attachment 88780 [details]
Backtrace of crash
Comment 2 Mark Stanton 2014-09-21 21:03:24 UTC
version 2.13.3.
This still isn't in the dropdown above
Comment 3 Oliver Kellogg 2014-09-22 22:34:26 UTC
Git commit 4ee55eae306b4a1169f7d8e5e7af20a14a74e64a by Oliver Kellogg.
Committed on 22/09/2014 at 22:36.
Pushed by okellogg into branch 'master'.

Address http://bugs.kde.org/attachment.cgi?id=88780

(In reply to Mark Stanton from comment #0)
> [...] The display doesn't resize and the app crashes.
> I may have tried this before the project had fully loaded. [...]

The backtrace confirms this, apparently you double clicked on a class widget
on a diagram while Umbrello was still busy in UMLDoc::resolveTypes().
By the way, Umbrello is finished loading when you see "Ready." in the lower
left corner of Umbrello's main window.

The following changes fend off double clicks on diagram objects while the
program is still busy in loadFromXMI() or resolveTypes():

umbrello/umldoc.cpp
- In default constructor, initialize m_bTypesAreResolved to true.
- In function closeDocument() remove assignment to m_bTypesAreResolved.
- In function openDocument(),
  - Add a few missing KIO::NetAccess::removeTempFile() calls in return-on-
    error situations;
  - Set m_bTypesAreResolved false before loadFromXMI()/loadFromMDL() calls;
  - Set m_bLoading false and m_bTypesAreResolved true before returning.
- In function loading() return true also when m_bTypesAreResolved is false.
- In function resolveTypes() postpone setting of m_bTypesAreResolved to true
  until type resolution has actually completed.

umbrello/umlscene.cpp
- In function mousePressEvent() call m_pToolBarState->mouseDoubleClick()
  only if m_doc->loading() returns false.

M  +18   -18   umbrello/umldoc.cpp
M  +2    -1    umbrello/umlscene.cpp

http://commits.kde.org/umbrello/4ee55eae306b4a1169f7d8e5e7af20a14a74e64a
Comment 4 Ralf Habacker 2014-10-27 09:04:44 UTC
Git commit cd9b676b941a42cf12f60b325b82284e51e2a354 by Ralf Habacker, on behalf of Oliver Kellogg.
Committed on 22/09/2014 at 22:36.
Pushed by habacker into branch 'master'.

Address http://bugs.kde.org/attachment.cgi?id=88780

(In reply to Mark Stanton from comment #0)
> [...] The display doesn't resize and the app crashes.
> I may have tried this before the project had fully loaded. [...]

The backtrace confirms this, apparently you double clicked on a class widget
on a diagram while Umbrello was still busy in UMLDoc::resolveTypes().
By the way, Umbrello is finished loading when you see "Ready." in the lower
left corner of Umbrello's main window.

The following changes fend off double clicks on diagram objects while the
program is still busy in loadFromXMI() or resolveTypes():

umbrello/umldoc.cpp
- In default constructor, initialize m_bTypesAreResolved to true.
- In function closeDocument() remove assignment to m_bTypesAreResolved.
- In function openDocument(),
  - Add a few missing KIO::NetAccess::removeTempFile() calls in return-on-
    error situations;
  - Set m_bTypesAreResolved false before loadFromXMI()/loadFromMDL() calls;
  - Set m_bLoading false and m_bTypesAreResolved true before returning.
- In function loading() return true also when m_bTypesAreResolved is false.
- In function resolveTypes() postpone setting of m_bTypesAreResolved to true
  until type resolution has actually completed.

umbrello/umlscene.cpp
- In function mousePressEvent() call m_pToolBarState->mouseDoubleClick()
  only if m_doc->loading() returns false.

M  +18   -18   umbrello/umldoc.cpp
M  +2    -1    umbrello/umlscene.cpp

http://commits.kde.org/umbrello/cd9b676b941a42cf12f60b325b82284e51e2a354