[seed] Removing g_autofree usage
- From: Danilo Cesar Lemes de Paula <danilocesar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seed] Removing g_autofree usage
- Date: Fri, 3 Jun 2016 14:07:45 +0000 (UTC)
commit 2d441004af6d556d79713ecd1dea3ea2fc64ea91
Author: Danilo Cesar Lemes de Paula <danilo cesar collabora co uk>
Date: Wed May 4 14:20:34 2016 -0300
Removing g_autofree usage
g_autofree is not supported on all platforms
libseed/seed-engine.c | 4 ++--
libseed/seed-importer.c | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/libseed/seed-engine.c b/libseed/seed-engine.c
index 3e1fe7b..f1a00ba 100644
--- a/libseed/seed-engine.c
+++ b/libseed/seed-engine.c
@@ -923,10 +923,10 @@ seed_gobject_method_invoked(JSContextRef ctx,
if (use_return_as_out) {
if (force_return_array) {
- gchar* int_str
- = g_strdup_printf("%d", array_return_count++);
+ gchar* int_str = g_strdup_printf("%d", array_return_count++);
seed_object_set_property(ctx, (JSObjectRef) retval_ref, int_str,
jsout_val);
+ g_free(int_str);
} else {
seed_object_set_property(ctx, (JSObjectRef) retval_ref,
g_base_info_get_name(
diff --git a/libseed/seed-importer.c b/libseed/seed-importer.c
index 2a66fbf..e2bd6cb 100644
--- a/libseed/seed-importer.c
+++ b/libseed/seed-importer.c
@@ -769,12 +769,13 @@ seed_importer_handle_file(JSContextRef ctx,
if (gi_imports && g_hash_table_lookup(gi_imports, module_name)) {
SEED_NOTE(IMPORTER, "Calling %s_init():", module_name);
- g_autofree gchar* initstr = g_strdup_printf(
+ gchar* initstr = g_strdup_printf(
"if (typeof(_init) === \"function\") { _init.apply(imports.gi.%s)}",
- module_name, module_name);
+ module_name);
initscript = JSStringCreateWithUTF8CString(initstr);
JSEvaluateScript(nctx, initscript, NULL, file_name, 0, exception);
JSStringRelease(initscript);
+ g_free(initstr);
}
// Does leak...but it's a debug statement.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]