plugins: free views that can't load

Trying to use an unloaded view can lead to crashes.
If a view can't be loaded, free it right away.
This commit is contained in:
Ray Strode 2015-09-24 15:55:08 -04:00
parent d33b4ef04e
commit 8d07bfd434

View file

@ -295,8 +295,12 @@ load_views (ply_boot_splash_plugin_t *plugin)
view = ply_list_node_get_data (node);
next_node = ply_list_get_next_node (plugin->views, node);
if (view_load (view))
if (view_load (view)) {
view_loaded = true;
} else {
ply_list_remove_node (plugin->views, node);
view_free (view);
}
node = next_node;
}