Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/41de6cb6f8ee73a712e305f8c1b6d34090a24523
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/41de6cb6f8ee73a712e305f8c1b6d34090a24523
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/41de6cb6f8ee73a712e305f8c1b6d34090a24523

The branch, master has been updated
       via  41de6cb6f8ee73a712e305f8c1b6d34090a24523 (commit)
      from  d448436cdb75a9d38a85a6a8bb9c9f6f3d3b85a2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=41de6cb6f8ee73a712e305f8c1b6d34090a24523
commit 41de6cb6f8ee73a712e305f8c1b6d34090a24523
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    Ensure the current scaffold remains valid
    
    When a scaffold was being destroyed the currently selected scaffold could 
become a reference to a destroyed object. This would result in crashes 
subsequently when the current scaffold was referenced.
    
    The change is simply to ensure the selected scaffold is changed to 
something valid during destruction.

diff --git a/frontends/gtk/scaffolding.c b/frontends/gtk/scaffolding.c
index 71c96a8..f9d4f6d 100644
--- a/frontends/gtk/scaffolding.c
+++ b/frontends/gtk/scaffolding.c
@@ -193,6 +193,18 @@ static void scaffolding_window_destroy(GtkWidget *widget, 
gpointer data)
 
        nsgtk_local_history_hide();
 
+       /* ensure scaffolding being destroyed is not current */
+       if (scaf_current == gs) {
+               scaf_current = NULL;
+               /* attempt to select nearest scaffold instead of just selecting 
the first */
+               if (gs->prev != NULL) {
+                       scaf_current = gs->prev;
+               } else if (gs->next != NULL) {
+                       scaf_current = gs->next;
+               }
+       }
+
+       /* remove scaffolding from list */
        if (gs->prev != NULL) {
                gs->prev->next = gs->next;
        } else {


-----------------------------------------------------------------------

Summary of changes:
 frontends/gtk/scaffolding.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/frontends/gtk/scaffolding.c b/frontends/gtk/scaffolding.c
index 71c96a8..f9d4f6d 100644
--- a/frontends/gtk/scaffolding.c
+++ b/frontends/gtk/scaffolding.c
@@ -193,6 +193,18 @@ static void scaffolding_window_destroy(GtkWidget *widget, 
gpointer data)
 
        nsgtk_local_history_hide();
 
+       /* ensure scaffolding being destroyed is not current */
+       if (scaf_current == gs) {
+               scaf_current = NULL;
+               /* attempt to select nearest scaffold instead of just selecting 
the first */
+               if (gs->prev != NULL) {
+                       scaf_current = gs->prev;
+               } else if (gs->next != NULL) {
+                       scaf_current = gs->next;
+               }
+       }
+
+       /* remove scaffolding from list */
        if (gs->prev != NULL) {
                gs->prev->next = gs->next;
        } else {


-- 
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to