Clients: Fix memleak issues in various clients of weston
In many clients of weston, Display was not being destroyed so added it. Also destroy windows, widgets which were not being destroyed. Signed-off-by: vivek <vivek.ellur@samsung.com> Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com> Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
This commit is contained in:
parent
1478ea54ca
commit
31732f7c68
@ -879,6 +879,14 @@ benchmark(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
cliptest_destroy(struct cliptest *cliptest)
|
||||
{
|
||||
widget_destroy(cliptest->widget);
|
||||
window_destroy(cliptest->window);
|
||||
free(cliptest);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
@ -897,9 +905,8 @@ main(int argc, char *argv[])
|
||||
cliptest = cliptest_create(d);
|
||||
display_run(d);
|
||||
|
||||
widget_destroy(cliptest->widget);
|
||||
window_destroy(cliptest->window);
|
||||
free(cliptest);
|
||||
cliptest_destroy(cliptest);
|
||||
display_destroy(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -639,6 +639,14 @@ dnd_create(struct display *display)
|
||||
return dnd;
|
||||
}
|
||||
|
||||
static void
|
||||
dnd_destroy(struct dnd *dnd)
|
||||
{
|
||||
widget_destroy(dnd->widget);
|
||||
window_destroy(dnd->window);
|
||||
free(dnd);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
@ -660,5 +668,8 @@ main(int argc, char *argv[])
|
||||
|
||||
display_run(d);
|
||||
|
||||
dnd_destroy(dnd);
|
||||
display_destroy(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1382,6 +1382,9 @@ main(int argc, char *argv[])
|
||||
|
||||
text_entry_destroy(editor.entry);
|
||||
text_entry_destroy(editor.editor);
|
||||
widget_destroy(editor.widget);
|
||||
window_destroy(editor.window);
|
||||
display_destroy(editor.display);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -195,5 +195,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
display_run(d);
|
||||
|
||||
widget_destroy(flower.widget);
|
||||
window_destroy(flower.window);
|
||||
display_destroy(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -562,5 +562,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
display_run(d);
|
||||
|
||||
widget_destroy(fullscreen.widget);
|
||||
window_destroy(fullscreen.window);
|
||||
display_destroy(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -469,17 +469,29 @@ gears_create(struct display *display)
|
||||
return gears;
|
||||
}
|
||||
|
||||
static void
|
||||
gears_destroy(struct gears *gears)
|
||||
{
|
||||
widget_destroy(gears->widget);
|
||||
window_destroy(gears->window);
|
||||
free(gears);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct display *d;
|
||||
struct gears *gears;
|
||||
|
||||
d = display_create(&argc, argv);
|
||||
if (d == NULL) {
|
||||
fprintf(stderr, "failed to create display: %m\n");
|
||||
return -1;
|
||||
}
|
||||
gears_create(d);
|
||||
gears = gears_create(d);
|
||||
display_run(d);
|
||||
|
||||
gears_destroy(gears);
|
||||
display_destroy(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -424,5 +424,7 @@ main(int argc, char *argv[])
|
||||
if (image_counter > 0)
|
||||
display_run(d);
|
||||
|
||||
display_destroy(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -321,6 +321,9 @@ main(int argc, char *argv[])
|
||||
|
||||
display_run(d);
|
||||
|
||||
widget_destroy(box.widget);
|
||||
window_destroy(box.window);
|
||||
display_destroy(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -329,5 +329,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
display_run(d);
|
||||
|
||||
widget_destroy(smoke.widget);
|
||||
window_destroy(smoke.window);
|
||||
display_destroy(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -304,5 +304,8 @@ main(int argc, char *argv[])
|
||||
|
||||
display_run(stacking.display);
|
||||
|
||||
window_destroy(stacking.root_window);
|
||||
display_destroy(stacking.display);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -290,6 +290,9 @@ int main(int argc, char *argv[])
|
||||
transformed.width, transformed.height);
|
||||
|
||||
display_run(d);
|
||||
widget_destroy(transformed.widget);
|
||||
window_destroy(transformed.window);
|
||||
display_destroy(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user