Exit more gracefully on web process crash.
This commit is contained in:
parent
befe481a9b
commit
c60523a702
14
surf.c
14
surf.c
|
@ -206,6 +206,9 @@ static void downloadstarted(WebKitWebContext *wc, WebKitDownload *d,
|
||||||
Client *c);
|
Client *c);
|
||||||
static void responsereceived(WebKitDownload *d, GParamSpec *ps, Client *c);
|
static void responsereceived(WebKitDownload *d, GParamSpec *ps, Client *c);
|
||||||
static void download(Client *c, WebKitURIResponse *r);
|
static void download(Client *c, WebKitURIResponse *r);
|
||||||
|
static void webprocessterminated(WebKitWebView *v,
|
||||||
|
WebKitWebProcessTerminationReason r,
|
||||||
|
Client *c);
|
||||||
static void closeview(WebKitWebView *v, Client *c);
|
static void closeview(WebKitWebView *v, Client *c);
|
||||||
static void destroywin(GtkWidget* w, Client *c);
|
static void destroywin(GtkWidget* w, Client *c);
|
||||||
|
|
||||||
|
@ -1187,6 +1190,8 @@ newview(Client *c, WebKitWebView *rv)
|
||||||
G_CALLBACK(permissionrequested), c);
|
G_CALLBACK(permissionrequested), c);
|
||||||
g_signal_connect(G_OBJECT(v), "ready-to-show",
|
g_signal_connect(G_OBJECT(v), "ready-to-show",
|
||||||
G_CALLBACK(showview), c);
|
G_CALLBACK(showview), c);
|
||||||
|
g_signal_connect(G_OBJECT(v), "web-process-terminated",
|
||||||
|
G_CALLBACK(webprocessterminated), c);
|
||||||
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
@ -1691,6 +1696,15 @@ download(Client *c, WebKitURIResponse *r)
|
||||||
spawn(c, &a);
|
spawn(c, &a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
webprocessterminated(WebKitWebView *v, WebKitWebProcessTerminationReason r,
|
||||||
|
Client *c)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "web process terminated: %s\n",
|
||||||
|
r == WEBKIT_WEB_PROCESS_CRASHED ? "crashed" : "no memory");
|
||||||
|
closeview(v, c);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
closeview(WebKitWebView *v, Client *c)
|
closeview(WebKitWebView *v, Client *c)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user