Commit 76545e55 authored by Robert Roth's avatar Robert Roth

Fix segfault on view mode change with process properties open.

https://bugzilla.gnome.org/show_bug.cgi?id=700552
parent f9362d06
......@@ -174,7 +174,8 @@ update_openfiles_dialog (GtkWidget *tree)
GHashTable *new_maps;
guint i;
info = static_cast<ProcInfo*>(g_object_get_data (G_OBJECT (tree), "selected_info"));
pid_t pid = GPOINTER_TO_UINT(static_cast<pid_t*>(g_object_get_data (G_OBJECT (tree), "selected_info")));
info = ProcInfo::find(pid);
if (!info)
return;
......@@ -353,7 +354,7 @@ create_single_openfiles_dialog (GtkTreeModel *model, GtkTreePath *path,
tree = create_openfiles_tree (app);
gtk_container_add (GTK_CONTAINER (scrolled), tree);
g_object_set_data (G_OBJECT (tree), "selected_info", info);
g_object_set_data (G_OBJECT (tree), "selected_info", GUINT_TO_POINTER (info->pid));
g_object_set_data (G_OBJECT (tree), "settings", app->settings);
g_signal_connect (G_OBJECT (openfilesdialog), "response",
......
......@@ -112,7 +112,8 @@ fill_proc_properties (GtkWidget *tree, ProcInfo *info)
guint i;
GtkListStore *store;
get_process_memory_info(info);
if (!info)
return;
#if defined (__OpenBSD__)
struct clockinfo cinf;
......@@ -167,10 +168,8 @@ update_procproperties_dialog (GtkWidget *tree)
{
ProcInfo *info;
info = static_cast<ProcInfo*>(g_object_get_data (G_OBJECT (tree), "selected_info"));
if (!info)
return;
pid_t pid = GPOINTER_TO_UINT(static_cast<pid_t*>(g_object_get_data (G_OBJECT (tree), "selected_info")));
info = ProcInfo::find(pid);
fill_proc_properties(tree, info);
}
......@@ -291,7 +290,7 @@ create_single_procproperties_dialog (GtkTreeModel *model, GtkTreePath *path,
tree = create_procproperties_tree (app);
gtk_container_add (GTK_CONTAINER (scrolled), tree);
g_object_set_data (G_OBJECT (tree), "selected_info", info);
g_object_set_data (G_OBJECT (tree), "selected_info", GUINT_TO_POINTER (info->pid));
gtk_box_pack_start (GTK_BOX (dialog_vbox), scrolled, TRUE, TRUE, 0);
gtk_widget_show_all (scrolled);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment