RSS/Atom feed Twitter
Site is read-only, email is disabled

Memory can not be released

This discussion is connected to the gegl-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Memory can not be released 史龙 12 Sep 07:21
  Memory can not be released Daniel Sabo 12 Sep 22:10
史龙
2013-09-12 07:21:02 UTC (about 11 years ago)

Memory can not be released

Hi,all

When I call the following function, my memory will rapidly increase.Can not be released after the call is completed.Please help me diagnose.Thank you very much.

void processXmlData(const char *pXmlData) {
GeglNode *node1 = NULL;
GeglNode *node2 = NULL;
GeglNode *node3 = NULL;
GeglBuffer *buffer = NULL;
double progress = 0;

node1 = gegl_node_new_from_xml (pXmlData, NULL); node2 = gegl_node_new_child (node1, "operation", "gegl:convert-format", "format", "B'aG'aR'aA u8", NULL); node3 = gegl_node_new_child (node1, "operation", "gegl:buffer-sink", "buffer", &buffer, NULL); gegl_node_link_many (node1, node2, node3, NULL);

GeglProcessor *processor = gegl_node_new_processor (node3, NULL); while (gegl_processor_work (processor, &progress)) {
}

g_object_unref (processor); g_object_unref (node2);
g_object_unref (node3);
g_object_unref (node1);
g_object_unref(buffer);
}

Thanks

Daniel Sabo
2013-09-12 22:10:51 UTC (about 11 years ago)

Memory can not be released

What do you mean by "can not be released"? You shouldn't unref node2 and node3 because gegl_node_new_child gives the only reference to the parent node (node1 in this case), but if something is leaking after you free processor, node1 and buffer that would be a bug.

On Thu, Sep 12, 2013 at 12:21 AM, 史龙 wrote:

Hi,all

When I call the following function, my memory will rapidly increase.Can not be released after the call is completed.Please help me diagnose.Thank you very much.

void processXmlData(const char *pXmlData)

{

GeglNode *node1 = NULL;

GeglNode *node2 = NULL;

GeglNode *node3 = NULL;

GeglBuffer *buffer = NULL;

double progress = 0;

node1 = gegl_node_new_from_xml (pXmlData, NULL);

node2 = gegl_node_new_child (node1,

"operation", "gegl:convert-format",

"format", "B'aG'aR'aA u8",

NULL);

node3 = gegl_node_new_child (node1,

"operation", "gegl:buffer-sink",

"buffer", &buffer,

NULL);

gegl_node_link_many (node1, node2, node3, NULL);

GeglProcessor *processor = gegl_node_new_processor (node3, NULL);

while (gegl_processor_work (processor, &progress))

{

}

g_object_unref (processor);

g_object_unref (node2);

g_object_unref (node3);

g_object_unref (node1);

g_object_unref(buffer);

}

Thanks

_______________________________________________ gegl-developer-list mailing list
gegl-developer-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gegl-developer-list