I'm wondering if someone here can point me in the right direction.
Simple test app. (Attached)
CEX100 backend.
GLES.
Clutter compiled with --with-imagebackend=internal
Basically textures are not being freed by clutter_actor_destroy and I eventually
crash out with a:
GLib-ERROR **: gmem.c:170 failed to allocate
Where might this leak be? That's a little open ended isn't it? I
guess I'm just
wondering what the usualy suspects might be.
Thanks,
Jake
#include <stdlib.h>
#include <stdio.h>
#include <cairo.h>
#include <gdl.h>
#include <cogl/cogl.h>
#include <clutter.h>
#include <clutter/egl/clutter-cex100.h>
#define STAGE_W 1920
#define STAGE_H 1080
static ClutterActor *stage;
static ClutterActor *actor;
static ClutterTimeline *timeline;
static int counter;
static void display_image(ClutterTimeline *timeline,
gint frame_num,
gpointer data)
{
ClutterActor *temp_stage = (ClutterActor *)data;
counter++;
switch(counter) {
case 10:
/* Create new actor with texture */
actor = clutter_texture_new_from_file("images/d0.png", NULL);
if(!actor) {
g_error("Unable to load.\n");
}
clutter_actor_set_size(actor, 1000, 700);
clutter_actor_set_position(actor, 0, 0);
clutter_container_add(CLUTTER_CONTAINER(temp_stage), actor, NULL);
clutter_actor_show(CLUTTER_ACTOR(actor));
break;
case 20:
/* Destoy Actor */
clutter_actor_destroy(CLUTTER_ACTOR(actor));
counter = 0;
break;
}
}
int main(int argc, char **argv)
{
const ClutterColor stage_color = {0x00, 0x00, 0x00, 0x00};
counter = 0;
clutter_cex100_set_plane(GDL_PLANE_ID_UPP_B);
clutter_init(&argc, &argv);
/* Setup Stage */
stage = clutter_stage_get_default();
clutter_stage_set_color(CLUTTER_STAGE(stage), &stage_color);
clutter_stage_set_use_alpha(CLUTTER_STAGE(stage), TRUE);
clutter_actor_show_all(CLUTTER_ACTOR(stage));
/* Setup Timeline */
timeline = clutter_timeline_new(10);
g_signal_connect(timeline, "new-frame", G_CALLBACK(display_image), stage);
clutter_timeline_set_loop(timeline, TRUE);
clutter_timeline_start(timeline);
clutter_main ();
return 0;
}
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list