mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
testsuite: Stop using g_slice
This commit is contained in:
parent
bcb0882208
commit
fe79c7db16
@ -126,7 +126,7 @@ gtk_tree_model_ref_count_finalize (GObject *object)
|
||||
static NodeInfo *
|
||||
node_info_new (void)
|
||||
{
|
||||
NodeInfo *info = g_slice_new (NodeInfo);
|
||||
NodeInfo *info = g_new (NodeInfo, 1);
|
||||
info->ref_count = 0;
|
||||
|
||||
return info;
|
||||
@ -135,7 +135,7 @@ node_info_new (void)
|
||||
static void
|
||||
node_info_free (NodeInfo *info)
|
||||
{
|
||||
g_slice_free (NodeInfo, info);
|
||||
g_free (info);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -45,7 +45,7 @@ recent_manager_add (void)
|
||||
|
||||
manager = gtk_recent_manager_get_default ();
|
||||
|
||||
recent_data = g_slice_new0 (GtkRecentData);
|
||||
recent_data = g_new0 (GtkRecentData, 1);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
@ -90,7 +90,7 @@ recent_manager_add (void)
|
||||
res = gtk_recent_manager_add_full (manager, uri, recent_data);
|
||||
g_assert_true (res);
|
||||
|
||||
g_slice_free (GtkRecentData, recent_data);
|
||||
g_free (recent_data);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@ -118,7 +118,7 @@ static gboolean
|
||||
add_bulk (gpointer data_)
|
||||
{
|
||||
AddManyClosure *closure = data_;
|
||||
GtkRecentData *data = g_slice_new0 (GtkRecentData);
|
||||
GtkRecentData *data = g_new0 (GtkRecentData, 1);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 100; i++)
|
||||
@ -139,7 +139,7 @@ add_bulk (gpointer data_)
|
||||
closure->counter += 1;
|
||||
}
|
||||
|
||||
g_slice_free (GtkRecentData, data);
|
||||
g_free (data);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
@ -283,12 +283,12 @@ recent_manager_purge (void)
|
||||
n = gtk_recent_manager_purge_items (manager, &error);
|
||||
g_assert_null (error);
|
||||
|
||||
recent_data = g_slice_new0 (GtkRecentData);
|
||||
recent_data = g_new0 (GtkRecentData, 1);
|
||||
recent_data->mime_type = (char *)"text/plain";
|
||||
recent_data->app_name = (char *)"testrecentchooser";
|
||||
recent_data->app_exec = (char *)"testrecentchooser %u";
|
||||
gtk_recent_manager_add_full (manager, uri, recent_data);
|
||||
g_slice_free (GtkRecentData, recent_data);
|
||||
g_free (recent_data);
|
||||
|
||||
error = NULL;
|
||||
n = gtk_recent_manager_purge_items (manager, &error);
|
||||
|
@ -145,7 +145,7 @@ static GtkTextHistoryFuncs funcs = {
|
||||
static Text *
|
||||
text_new (void)
|
||||
{
|
||||
Text *text = g_slice_new0 (Text);
|
||||
Text *text = g_new0 (Text, 1);
|
||||
|
||||
text->history = gtk_text_history_new (&funcs, text);
|
||||
text->buf = g_string_new (NULL);
|
||||
@ -160,7 +160,7 @@ text_free (Text *text)
|
||||
{
|
||||
g_object_unref (text->history);
|
||||
g_string_free (text->buf, TRUE);
|
||||
g_slice_free (Text, text);
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -45,7 +45,7 @@ reftest_module_new_take (GModule *module,
|
||||
|
||||
g_return_val_if_fail (module != NULL, NULL);
|
||||
|
||||
result = g_slice_new0 (ReftestModule);
|
||||
result = g_new0 (ReftestModule, 1);
|
||||
|
||||
result->refcount = 1;
|
||||
result->filename = filename;
|
||||
@ -135,7 +135,7 @@ reftest_module_unref (ReftestModule *module)
|
||||
}
|
||||
|
||||
g_free (module->filename);
|
||||
g_slice_free (ReftestModule, module);
|
||||
g_free (module);
|
||||
}
|
||||
|
||||
GCallback
|
||||
|
Loading…
Reference in New Issue
Block a user