Fix crash in app monitor on 64 bits CPUs
Pointers and integers are not the same size, use GPOINTER_TO_INT() for conversion. http://bugzilla.gnome.org/show_bug.cgi?id=584539
This commit is contained in:
parent
015d10b87e
commit
ef3ac7a7f6
@ -693,6 +693,8 @@ static void
|
|||||||
save_to_file (ShellAppMonitor *monitor)
|
save_to_file (ShellAppMonitor *monitor)
|
||||||
{
|
{
|
||||||
GHashTableIter iter;
|
GHashTableIter iter;
|
||||||
|
gpointer key;
|
||||||
|
gpointer value;
|
||||||
int activity;
|
int activity;
|
||||||
GSList *popularity;
|
GSList *popularity;
|
||||||
AppPopularity *app_popularity;
|
AppPopularity *app_popularity;
|
||||||
@ -721,9 +723,11 @@ save_to_file (ShellAppMonitor *monitor)
|
|||||||
g_object_unref (output);
|
g_object_unref (output);
|
||||||
|
|
||||||
g_hash_table_iter_init (&iter, monitor->popularities);
|
g_hash_table_iter_init (&iter, monitor->popularities);
|
||||||
while (g_hash_table_iter_next (&iter, (gpointer *) &activity, (gpointer *) &popularity)
|
while (g_hash_table_iter_next (&iter, &key, &value) && value)
|
||||||
&& popularity)
|
|
||||||
{
|
{
|
||||||
|
activity = GPOINTER_TO_INT (key);
|
||||||
|
popularity = value;
|
||||||
|
|
||||||
line = g_strdup_printf ("%i\n", activity);
|
line = g_strdup_printf ("%i\n", activity);
|
||||||
g_data_output_stream_put_string (data_output, "--\n", NULL, NULL);
|
g_data_output_stream_put_string (data_output, "--\n", NULL, NULL);
|
||||||
g_data_output_stream_put_string (data_output, line, NULL, NULL);
|
g_data_output_stream_put_string (data_output, line, NULL, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user