Bug report #17673
QGIS crash on close when Spatial Bookmarks panel is showing as a floating window
|Affected QGIS version:||master||Regression?:||Yes|
|Operating System:||Windows 8.1, 7 x64||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||25570|
Using master (010cb1567b)
Doesn't crash if the bookmarks panel is docked or isn't showing.
2.18.15 also crashes on close under the same conditions.
h2. User Feedback
Crash ID: 9ca8f947470220027da8b0cb78fbece8d2987297
QgsOptions::tr : QgsOptions::tr : QHeaderView::sectionSizeFromContents : QHeaderView::sizeHint : QTreeView::updateGeometries : QMetaObject::activate : QHeaderView::viewportEvent : QCoreApplicationPrivate::sendThroughObjectEventFilters : QApplicationPrivate::notify_helper : QApplication::notify : QgsWkbException::QgsWkbException : QCoreApplication::notifyInternal2 : QWidgetPrivate::hideChildren : QWidgetPrivate::hideChildren : QWidgetPrivate::hideChildren : QWidgetPrivate::hideChildren : QWidgetPrivate::hide_helper : QWidget::setVisible : QWidgetPrivate::close_helper : QWidget::~QWidget : QgsShadowEffectWidget::initGui : QgsOptions::tr : QgsOptions::tr : QObjectPrivate::deleteChildren : QWidget::~QWidget : QgsOptions::tr : QgsOptions::tr : QgsOptions::tr : BaseThreadInitThunk : RtlUserThreadStart :
QGIS Version: 2.99.0-Master
QGIS code revision: 010cb1567b
Compiled against Qt: 5.9.2
Running against Qt: 5.9.2
Compiled against GDAL: 2.2.3
Running against GDAL: 2.2.3
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 6.3.9600
#2 Updated by Steven Mizuno almost 4 years ago
- Operating System set to Windows 8.1, 7 x64
1. start QGIS
2. open Spatial Bookmarks
3. if panel is docked, undock it so it is a separate window (the little button or just drag it off the main window)
4. close QGIS (I normally use the close button, but have tried Exit on the Project menu, too)
Perhaps I could have been more specific about using Windows 8.1 and Windows 7, both x64 systems.
I tried OSGeo4W builds as well as my own builds which are based on OSGeo4W libraries, etc.
And I didn't experience the crash if other dockwidgets are floating, specifically GPS Information and Python Console.
#3 Updated by Steven Mizuno almost 4 years ago
After comparing QgsBookmarks code before and after the recent changes, I believe the QgsBookmarks destructor should delete mProxyModel, either directly or through lstBookmarks->model(), rather than deleting mQgisModel.
I have tried this in my own building of master and 2.18.15 and no longer get the crash.
#5 Updated by Alessandro Pasotti over 3 years ago
- Pull Request or Patch supplied changed from No to Yes
- Assignee set to Alessandro Pasotti
Nevermind: mQgisModel must be deleted otherwise it would leak, btw the order of destructors does matter here, so I'm now deleting the proxy model directly instead of leaving it to the parent (which is now a nullptr).
Btw, if you can take care of backporting my latest fixes to 2.18 it would be much appreciated.
#8 Updated by Steven Mizuno over 3 years ago
PR filed: https://github.com/qgis/QGIS/pull/6032
I have tested the changes in 2.18 from having no bookmarks to exporting and importing bookmarks, setting project bookmarks, and deleting both QGIS and project bookmarks. And no crash on closing QGIS if the bookmarks panel is floating.