mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-14 08:56:26 -05:00
Merge pull request #88 from 4e554c4c/alloc_crashing
Prevent alloc errors from crashing
This commit is contained in:
commit
27c13d621d
13 changed files with 109 additions and 13 deletions
|
|
@ -73,6 +73,10 @@ int main() {
|
|||
compositor_init(&compositor);
|
||||
|
||||
state.renderer = wlr_gles2_renderer_init(compositor.backend);
|
||||
if (!state.renderer) {
|
||||
wlr_log(L_ERROR, "Could not start compositor, OOM");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
wl_display_init_shm(compositor.display);
|
||||
wl_compositor_init(compositor.display, &state.compositor, state.renderer);
|
||||
wl_shell_init(compositor.display, &state.shell);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include <wlr/backend.h>
|
||||
#include <wlr/backend/session.h>
|
||||
#include <wlr/types/wlr_keyboard.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include <math.h>
|
||||
#include "shared.h"
|
||||
#include "cat.h"
|
||||
|
|
@ -205,7 +206,15 @@ int main(int argc, char *argv[]) {
|
|||
compositor_init(&compositor);
|
||||
|
||||
state.renderer = wlr_gles2_renderer_init(compositor.backend);
|
||||
if (!state.renderer) {
|
||||
wlr_log(L_ERROR, "Could not start compositor, OOM");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
state.cat_texture = wlr_render_texture_init(state.renderer);
|
||||
if (!state.cat_texture) {
|
||||
wlr_log(L_ERROR, "Could not start compositor, OOM");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
wlr_texture_upload_pixels(state.cat_texture, WL_SHM_FORMAT_ABGR8888,
|
||||
cat_tex.width, cat_tex.width, cat_tex.height, cat_tex.pixel_data);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include <wlr/types/wlr_output.h>
|
||||
#include <wlr/types/wlr_tablet_tool.h>
|
||||
#include <wlr/types/wlr_tablet_pad.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include <math.h>
|
||||
#include "shared.h"
|
||||
#include "cat.h"
|
||||
|
|
@ -153,6 +154,10 @@ int main(int argc, char *argv[]) {
|
|||
compositor_init(&compositor);
|
||||
|
||||
state.renderer = wlr_gles2_renderer_init(compositor.backend);
|
||||
if (!state.renderer) {
|
||||
wlr_log(L_ERROR, "Could not start compositor, OOM");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
compositor_run(&compositor);
|
||||
|
||||
wlr_renderer_destroy(state.renderer);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include <wlr/backend.h>
|
||||
#include <wlr/backend/session.h>
|
||||
#include <wlr/util/list.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "shared.h"
|
||||
#include "cat.h"
|
||||
|
||||
|
|
@ -105,7 +106,15 @@ int main(int argc, char *argv[]) {
|
|||
compositor_init(&compositor);
|
||||
|
||||
state.renderer = wlr_gles2_renderer_init(compositor.backend);
|
||||
if (!state.renderer) {
|
||||
wlr_log(L_ERROR, "Could not start compositor, OOM");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
state.cat_texture = wlr_render_texture_init(state.renderer);
|
||||
if (!state.cat_texture) {
|
||||
wlr_log(L_ERROR, "Could not start compositor, OOM");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
wlr_texture_upload_pixels(state.cat_texture, WL_SHM_FORMAT_ARGB8888,
|
||||
cat_tex.width, cat_tex.width, cat_tex.height, cat_tex.pixel_data);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue