Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/Remmina/Remmina.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGiovanni Panozzo <giovanni@panozzo.it>2022-12-15 21:44:15 +0300
committerGiovanni Panozzo <giovanni@panozzo.it>2022-12-15 21:44:15 +0300
commit151d8d089398bacd0df6c04e98f20460d927ceab (patch)
tree7be634cdda71be61b854709185d3f4be376dc11b /src
parent4cfd61fca54820451d9de0c72d49a7b629ff16ab (diff)
Avoid crash when closing, fixes issue #2832
Diffstat (limited to 'src')
-rw-r--r--src/rcw.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/rcw.c b/src/rcw.c
index 49fc4c562..0cc4289e5 100644
--- a/src/rcw.c
+++ b/src/rcw.c
@@ -3476,19 +3476,27 @@ void rco_closewin(RemminaProtocolWidget *gp)
RemminaConnectionObject *cnnobj = gp->cnnobj;
GtkWidget *page_to_remove;
+
+ if (cnnobj && cnnobj->scrolled_container && REMMINA_IS_SCROLLED_VIEWPORT(cnnobj->scrolled_container)) {
+ REMMINA_DEBUG("deleting motion");
+ remmina_scrolled_viewport_remove_motion(REMMINA_SCROLLED_VIEWPORT(cnnobj->scrolled_container));
+ }
+
if (cnnobj && cnnobj->cnnwin) {
page_to_remove = nb_find_page_by_cnnobj(cnnobj->cnnwin->priv->notebook, cnnobj);
if (page_to_remove) {
gtk_notebook_remove_page(
cnnobj->cnnwin->priv->notebook,
gtk_notebook_page_num(cnnobj->cnnwin->priv->notebook, page_to_remove));
+ /* Invalidate pointers to objects destroyed by page removal */
+ cnnobj->aspectframe = NULL;
+ cnnobj->viewport = NULL;
+ cnnobj->scrolled_container = NULL;
+ /* we cannot invalidate cnnobj->proto, because it can be already been
+ * detached from the widget hierarchy in rco_on_disconnect() */
}
}
if (cnnobj) {
- if (cnnobj->scrolled_container && REMMINA_IS_SCROLLED_VIEWPORT(cnnobj->scrolled_container)) {
- REMMINA_DEBUG("deleting motion");
- remmina_scrolled_viewport_remove_motion(REMMINA_SCROLLED_VIEWPORT(cnnobj->scrolled_container));
- }
cnnobj->remmina_file = NULL;
g_free(cnnobj);
gp->cnnobj = NULL;