summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/locationinformation.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-09-06 22:01:59 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-09-07 08:28:29 -0700
commite3cd0891d312c448db6d6a19464efd3c521cd153 (patch)
tree0d6700f8ea71ecbcde10763dab23ca785532e49f /desktop-widgets/locationinformation.h
parent4479ccf8f32a0241e51dd5dcbcec28d2d26fb7af (diff)
downloadsubsurface-e3cd0891d312c448db6d6a19464efd3c521cd153.tar.gz
Dive site: close dive site edit widget when dive site is deleted
The application could be crashed by 1) Create dive site 2) Edit dive site 3) Undo until dive site is removed 4) Continue editing now non-existing dive site Therefore, hook into the dive-site-deleted signal and if the currently edited dive site is deleted, close the widget. When closing the widget, make sure that the potentially dangling pointer is reset to zero so that there is no other potential use-after-free bug. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/locationinformation.h')
-rw-r--r--desktop-widgets/locationinformation.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/desktop-widgets/locationinformation.h b/desktop-widgets/locationinformation.h
index b6122d2fe..0e53a4439 100644
--- a/desktop-widgets/locationinformation.h
+++ b/desktop-widgets/locationinformation.h
@@ -34,6 +34,7 @@ public slots:
private slots:
void updateLabels();
void diveSiteChanged(struct dive_site *ds, int field);
+ void diveSiteDeleted(struct dive_site *ds, int);
void unitsChanged();
private:
void keyPressEvent(QKeyEvent *e) override;