g_free (element->script_content);
g_slist_free (element->includes);
g_slist_free (element->excludes);
+ g_slice_free (struct AddonElement, element);
elements = g_slist_next (elements);
}
gchar* tooltip;
fullpath = addon_files->data;
- element = g_new (struct AddonElement, 1);
+ element = g_slice_new (struct AddonElement);
element->displayname = g_filename_display_basename (fullpath);
element->fullpath = fullpath;
element->enabled = TRUE;
g_free (config_file);
g_key_file_free (keyfile);
- if (addons_list)
- g_free (addons_list);
- addons_list = g_new (struct AddonsList, 1);
+ g_slice_free (struct AddonsList, addons_list);
+ addons_list = g_slice_new (struct AddonsList);
addons_list->elements = elements;
addons_list->liststore = liststore;
if (!g_hash_table_lookup (save->http_auth->logins, opaque_info))
{
- KatzeHttpAuthLogin* login;
- login = g_new (KatzeHttpAuthLogin, 1);
+ KatzeHttpAuthLogin* login = g_slice_new (KatzeHttpAuthLogin);
login->username = save->username;
login->password = save->password;
g_hash_table_insert (save->http_auth->logins, opaque_info, login);
}
/* FIXME g_object_unref (save->auth); */
- /* FIXME g_free (save); */
+ /* FIXME g_slice_free (KatzeHttpAuthSave, save); */
g_signal_handlers_disconnect_by_func (msg,
authentication_message_got_headers_cb, save);
}
else
{
g_object_unref (save->auth);
- g_free (save);
+ g_slice_free (KatzeHttpAuthSave, save);
}
}
g_object_set_data (G_OBJECT (dialog), "session", session);
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->auth = g_object_ref (auth);
g_signal_connect (dialog, "response",
{
g_free (login->username);
g_free (login->password);
- g_free (login);
+ g_slice_free (KatzeHttpAuthLogin, login);
}
static void
gchar** parts = g_strsplit (line, "\t", 3);
if (parts && parts[0] && parts[1] && parts[2])
{
- KatzeHttpAuthLogin* login;
- gint length;
-
- login = g_new (KatzeHttpAuthLogin, 1);
+ gint length = strlen (parts[2]);
+ KatzeHttpAuthLogin* login = g_slice_new (KatzeHttpAuthLogin);
login->username = parts[1];
- length = strlen (parts[2]);
if (parts[2][length - 1] == '\n')
length--;
login->password = g_strndup (parts[2], length);
static void
katze_net_priv_free (KatzeNetPriv* priv)
{
- KatzeNetRequest* request;
-
- request = priv->request;
-
+ KatzeNetRequest* request = priv->request;
g_free (request->uri);
g_free (request->mime_type);
g_free (request->data);
-
- g_free (request);
- g_free (priv);
+ g_slice_free (KatzeNetRequest, request);
+ g_slice_free (KatzeNetPriv, priv);
}
gchar*
if (!status_cb && !transfer_cb)
return;
- request = g_new0 (KatzeNetRequest, 1);
+ request = g_slice_new (KatzeNetRequest);
request->uri = g_strdup (uri);
request->mime_type = NULL;
request->data = NULL;
- priv = g_new0 (KatzeNetPriv, 1);
+ priv = g_slice_new (KatzeNetPriv);
priv->status_cb = status_cb;
priv->transfer_cb = transfer_cb;
priv->user_data = user_data;
EventHandlerData* data;
gboolean stop_propagating;
- state = g_new0 (KatzeScrolledState, 1);
+ state = g_slice_new (KatzeScrolledState);
state->current_event_handler = g_list_first (event_handlers);
if (state->current_event_handler)
{
else
gtk_main_do_event (event);
- g_free (state);
+ g_slice_free (KatzeScrolledState, state);
}
static GdkWindow* current_gdk_window;
{
g_free (priv->icon_file);
g_free (priv->icon_uri);
- g_free (priv);
+ g_slice_free (KatzeNetIconPriv, priv);
}
static gboolean
}
else
{
- priv = g_new0 (KatzeNetIconPriv, 1);
+ priv = g_slice_new (KatzeNetIconPriv);
priv->icon_file = icon_file;
priv->icon_uri = icon_uri;
priv->view = view;
transferbar->infos = g_list_remove (transferbar->infos, info);
g_object_unref (info->download);
gtk_widget_destroy (info->toolitem);
- g_free (info);
+ g_slice_free (TransferInfo, info);
if (!transferbar->infos || !g_list_nth_data (transferbar->infos, 0))
gtk_widget_hide (GTK_WIDGET (transferbar->clear));
gtk_toolbar_insert (GTK_TOOLBAR (transferbar), toolitem, 0);
gtk_widget_show (GTK_WIDGET (transferbar->clear));
- info = g_new (TransferInfo, 1);
+ info = g_slice_new (TransferInfo);
info->download = g_object_ref (download);
info->button = button;
info->toolitem = GTK_WIDGET (toolitem);