diff options
author | Marcus Lundblad <ml@dfupdate.se> | 2022-12-13 21:51:23 +0100 |
---|---|---|
committer | Marcus Lundblad <ml@dfupdate.se> | 2022-12-13 21:51:23 +0100 |
commit | 059f1f58f721cdf40d88a90d8f2b992d8c446477 (patch) | |
tree | b08109328dd15cf01097dc8b8b0e1f109b3df7e6 | |
parent | a4a9c977b43d89356be37c63cfd9db52a18fe47c (diff) | |
download | gnome-maps-wip/mlundblad/fix-unitialized-in-shutdown.tar.gz |
application: Don't access unitialized variable in shutdownwip/mlundblad/fix-unitialized-in-shutdown
Guard all usage of this._mainWindow from being used when
uninitialized in the shutdown vfunc. This happens e.g.
when running with the --version command line flag.
-rw-r--r-- | src/application.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/application.js b/src/application.js index b0099891..d787dea3 100644 --- a/src/application.js +++ b/src/application.js @@ -363,8 +363,9 @@ export class Application extends Adw.Application { // need to unparent popover children to avoid GTK warnings on exit if (this._mainWindow) { this._mainWindow.placeEntry.popover.unparent(); + this._mainWindow.sidebar.unparentSearchPopovers(); } - this._mainWindow.sidebar.unparentSearchPopovers(); + super.vfunc_shutdown(); } } |