Slice allocations in addons, net, scrolled, transferbar
This commit is contained in:
parent
45ebf4dcdb
commit
68c12e950e
6 changed files with 22 additions and 30 deletions
|
@ -527,6 +527,7 @@ addons_free_elements (GSList* elements)
|
||||||
g_free (element->script_content);
|
g_free (element->script_content);
|
||||||
g_slist_free (element->includes);
|
g_slist_free (element->includes);
|
||||||
g_slist_free (element->excludes);
|
g_slist_free (element->excludes);
|
||||||
|
g_slice_free (struct AddonElement, element);
|
||||||
|
|
||||||
elements = g_slist_next (elements);
|
elements = g_slist_next (elements);
|
||||||
}
|
}
|
||||||
|
@ -998,7 +999,7 @@ addons_update_elements (MidoriExtension* extension,
|
||||||
gchar* tooltip;
|
gchar* tooltip;
|
||||||
|
|
||||||
fullpath = addon_files->data;
|
fullpath = addon_files->data;
|
||||||
element = g_new (struct AddonElement, 1);
|
element = g_slice_new (struct AddonElement);
|
||||||
element->displayname = g_filename_display_basename (fullpath);
|
element->displayname = g_filename_display_basename (fullpath);
|
||||||
element->fullpath = fullpath;
|
element->fullpath = fullpath;
|
||||||
element->enabled = TRUE;
|
element->enabled = TRUE;
|
||||||
|
@ -1065,9 +1066,8 @@ addons_update_elements (MidoriExtension* extension,
|
||||||
g_free (config_file);
|
g_free (config_file);
|
||||||
g_key_file_free (keyfile);
|
g_key_file_free (keyfile);
|
||||||
|
|
||||||
if (addons_list)
|
g_slice_free (struct AddonsList, addons_list);
|
||||||
g_free (addons_list);
|
addons_list = g_slice_new (struct AddonsList);
|
||||||
addons_list = g_new (struct AddonsList, 1);
|
|
||||||
addons_list->elements = elements;
|
addons_list->elements = elements;
|
||||||
addons_list->liststore = liststore;
|
addons_list->liststore = liststore;
|
||||||
|
|
||||||
|
|
|
@ -103,8 +103,7 @@ authentication_message_got_headers_cb (SoupMessage* msg,
|
||||||
|
|
||||||
if (!g_hash_table_lookup (save->http_auth->logins, opaque_info))
|
if (!g_hash_table_lookup (save->http_auth->logins, opaque_info))
|
||||||
{
|
{
|
||||||
KatzeHttpAuthLogin* login;
|
KatzeHttpAuthLogin* login = g_slice_new (KatzeHttpAuthLogin);
|
||||||
login = g_new (KatzeHttpAuthLogin, 1);
|
|
||||||
login->username = save->username;
|
login->username = save->username;
|
||||||
login->password = save->password;
|
login->password = save->password;
|
||||||
g_hash_table_insert (save->http_auth->logins, opaque_info, login);
|
g_hash_table_insert (save->http_auth->logins, opaque_info, login);
|
||||||
|
@ -130,7 +129,7 @@ authentication_message_got_headers_cb (SoupMessage* msg,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME g_object_unref (save->auth); */
|
/* FIXME g_object_unref (save->auth); */
|
||||||
/* FIXME g_free (save); */
|
/* FIXME g_slice_free (KatzeHttpAuthSave, save); */
|
||||||
g_signal_handlers_disconnect_by_func (msg,
|
g_signal_handlers_disconnect_by_func (msg,
|
||||||
authentication_message_got_headers_cb, save);
|
authentication_message_got_headers_cb, save);
|
||||||
}
|
}
|
||||||
|
@ -164,7 +163,7 @@ authentication_dialog_response_cb (GtkWidget* dialog,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_object_unref (save->auth);
|
g_object_unref (save->auth);
|
||||||
g_free (save);
|
g_slice_free (KatzeHttpAuthSave, save);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,7 +279,7 @@ katze_http_auth_session_authenticate_cb (SoupSession* session,
|
||||||
g_object_set_data (G_OBJECT (dialog), "session", session);
|
g_object_set_data (G_OBJECT (dialog), "session", session);
|
||||||
g_object_set_data (G_OBJECT (dialog), "msg", msg);
|
g_object_set_data (G_OBJECT (dialog), "msg", msg);
|
||||||
|
|
||||||
save = g_new (KatzeHttpAuthSave, 1);
|
save = g_slice_new0 (KatzeHttpAuthSave);
|
||||||
save->http_auth = http_auth;
|
save->http_auth = http_auth;
|
||||||
save->auth = g_object_ref (auth);
|
save->auth = g_object_ref (auth);
|
||||||
g_signal_connect (dialog, "response",
|
g_signal_connect (dialog, "response",
|
||||||
|
@ -366,7 +365,7 @@ katze_http_auth_login_free (KatzeHttpAuthLogin* login)
|
||||||
{
|
{
|
||||||
g_free (login->username);
|
g_free (login->username);
|
||||||
g_free (login->password);
|
g_free (login->password);
|
||||||
g_free (login);
|
g_slice_free (KatzeHttpAuthLogin, login);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -389,12 +388,9 @@ katze_http_auth_set_filename (KatzeHttpAuth* http_auth,
|
||||||
gchar** parts = g_strsplit (line, "\t", 3);
|
gchar** parts = g_strsplit (line, "\t", 3);
|
||||||
if (parts && parts[0] && parts[1] && parts[2])
|
if (parts && parts[0] && parts[1] && parts[2])
|
||||||
{
|
{
|
||||||
KatzeHttpAuthLogin* login;
|
gint length = strlen (parts[2]);
|
||||||
gint length;
|
KatzeHttpAuthLogin* login = g_slice_new (KatzeHttpAuthLogin);
|
||||||
|
|
||||||
login = g_new (KatzeHttpAuthLogin, 1);
|
|
||||||
login->username = parts[1];
|
login->username = parts[1];
|
||||||
length = strlen (parts[2]);
|
|
||||||
if (parts[2][length - 1] == '\n')
|
if (parts[2][length - 1] == '\n')
|
||||||
length--;
|
length--;
|
||||||
login->password = g_strndup (parts[2], length);
|
login->password = g_strndup (parts[2], length);
|
||||||
|
|
|
@ -95,16 +95,12 @@ typedef struct
|
||||||
static void
|
static void
|
||||||
katze_net_priv_free (KatzeNetPriv* priv)
|
katze_net_priv_free (KatzeNetPriv* priv)
|
||||||
{
|
{
|
||||||
KatzeNetRequest* request;
|
KatzeNetRequest* request = priv->request;
|
||||||
|
|
||||||
request = priv->request;
|
|
||||||
|
|
||||||
g_free (request->uri);
|
g_free (request->uri);
|
||||||
g_free (request->mime_type);
|
g_free (request->mime_type);
|
||||||
g_free (request->data);
|
g_free (request->data);
|
||||||
|
g_slice_free (KatzeNetRequest, request);
|
||||||
g_free (request);
|
g_slice_free (KatzeNetPriv, priv);
|
||||||
g_free (priv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar*
|
gchar*
|
||||||
|
@ -276,12 +272,12 @@ katze_net_load_uri (KatzeNet* net,
|
||||||
if (!status_cb && !transfer_cb)
|
if (!status_cb && !transfer_cb)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
request = g_new0 (KatzeNetRequest, 1);
|
request = g_slice_new (KatzeNetRequest);
|
||||||
request->uri = g_strdup (uri);
|
request->uri = g_strdup (uri);
|
||||||
request->mime_type = NULL;
|
request->mime_type = NULL;
|
||||||
request->data = NULL;
|
request->data = NULL;
|
||||||
|
|
||||||
priv = g_new0 (KatzeNetPriv, 1);
|
priv = g_slice_new (KatzeNetPriv);
|
||||||
priv->status_cb = status_cb;
|
priv->status_cb = status_cb;
|
||||||
priv->transfer_cb = transfer_cb;
|
priv->transfer_cb = transfer_cb;
|
||||||
priv->user_data = user_data;
|
priv->user_data = user_data;
|
||||||
|
|
|
@ -203,7 +203,7 @@ katze_scrolled_event_handler_func (GdkEvent* event,
|
||||||
EventHandlerData* data;
|
EventHandlerData* data;
|
||||||
gboolean stop_propagating;
|
gboolean stop_propagating;
|
||||||
|
|
||||||
state = g_new0 (KatzeScrolledState, 1);
|
state = g_slice_new (KatzeScrolledState);
|
||||||
state->current_event_handler = g_list_first (event_handlers);
|
state->current_event_handler = g_list_first (event_handlers);
|
||||||
if (state->current_event_handler)
|
if (state->current_event_handler)
|
||||||
{
|
{
|
||||||
|
@ -216,7 +216,7 @@ katze_scrolled_event_handler_func (GdkEvent* event,
|
||||||
else
|
else
|
||||||
gtk_main_do_event (event);
|
gtk_main_do_event (event);
|
||||||
|
|
||||||
g_free (state);
|
g_slice_free (KatzeScrolledState, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GdkWindow* current_gdk_window;
|
static GdkWindow* current_gdk_window;
|
||||||
|
|
|
@ -764,7 +764,7 @@ katze_net_icon_priv_free (KatzeNetIconPriv* priv)
|
||||||
{
|
{
|
||||||
g_free (priv->icon_file);
|
g_free (priv->icon_file);
|
||||||
g_free (priv->icon_uri);
|
g_free (priv->icon_uri);
|
||||||
g_free (priv);
|
g_slice_free (KatzeNetIconPriv, priv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -896,7 +896,7 @@ _midori_web_view_load_icon (MidoriView* view)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
priv = g_new0 (KatzeNetIconPriv, 1);
|
priv = g_slice_new (KatzeNetIconPriv);
|
||||||
priv->icon_file = icon_file;
|
priv->icon_file = icon_file;
|
||||||
priv->icon_uri = icon_uri;
|
priv->icon_uri = icon_uri;
|
||||||
priv->view = view;
|
priv->view = view;
|
||||||
|
|
|
@ -55,7 +55,7 @@ midori_transferbar_info_free (gpointer data)
|
||||||
transferbar->infos = g_list_remove (transferbar->infos, info);
|
transferbar->infos = g_list_remove (transferbar->infos, info);
|
||||||
g_object_unref (info->download);
|
g_object_unref (info->download);
|
||||||
gtk_widget_destroy (info->toolitem);
|
gtk_widget_destroy (info->toolitem);
|
||||||
g_free (info);
|
g_slice_free (TransferInfo, info);
|
||||||
|
|
||||||
if (!transferbar->infos || !g_list_nth_data (transferbar->infos, 0))
|
if (!transferbar->infos || !g_list_nth_data (transferbar->infos, 0))
|
||||||
gtk_widget_hide (GTK_WIDGET (transferbar->clear));
|
gtk_widget_hide (GTK_WIDGET (transferbar->clear));
|
||||||
|
@ -210,7 +210,7 @@ midori_transferbar_add_download_item (MidoriTransferbar* transferbar,
|
||||||
gtk_toolbar_insert (GTK_TOOLBAR (transferbar), toolitem, 0);
|
gtk_toolbar_insert (GTK_TOOLBAR (transferbar), toolitem, 0);
|
||||||
gtk_widget_show (GTK_WIDGET (transferbar->clear));
|
gtk_widget_show (GTK_WIDGET (transferbar->clear));
|
||||||
|
|
||||||
info = g_new (TransferInfo, 1);
|
info = g_slice_new (TransferInfo);
|
||||||
info->download = g_object_ref (download);
|
info->download = g_object_ref (download);
|
||||||
info->button = button;
|
info->button = button;
|
||||||
info->toolitem = GTK_WIDGET (toolitem);
|
info->toolitem = GTK_WIDGET (toolitem);
|
||||||
|
|
Loading…
Reference in a new issue