diff options
author | André Stösel <andre@stoesel.de> | 2013-07-07 14:37:20 +0200 |
---|---|---|
committer | André Stösel <andre@stoesel.de> | 2013-07-07 14:37:20 +0200 |
commit | 7aac7a069da44f2862532a9ef9d1aff00ac5e455 (patch) | |
tree | 519b667c512072e63ac47721b957ddbe8e80ef6e | |
parent | de607de455e9748e95706440419d986e666a946d (diff) | |
download | midori-7aac7a069da44f2862532a9ef9d1aff00ac5e455.tar.gz |
Fixed bug which occurs when midori_web_settings_skip_plugin is called multiple times
-rw-r--r-- | midori/midori-websettings.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index d03af122..3f52d374 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -605,9 +605,9 @@ midori_web_settings_has_plugin_support (void) gboolean midori_web_settings_skip_plugin (const gchar* path) { - static GHashTable* plugins = NULL; gchar* basename = NULL; + gchar* plugin_path = NULL; if (!path) return TRUE; @@ -617,14 +617,20 @@ midori_web_settings_skip_plugin (const gchar* path) basename = g_path_get_basename (path); - if (g_hash_table_lookup (plugins, basename) != NULL) + plugin_path = g_hash_table_lookup (plugins, basename); + if (g_strcmp0 (path, plugin_path) == 0) + { + return FALSE; + } + + if (plugin_path != NULL) { g_free (basename); return TRUE; } - g_hash_table_insert (plugins, basename, GINT_TO_POINTER (1)); + g_hash_table_insert (plugins, basename, g_strdup (path)); /* Note: do not free basename */ |