comparison src/graph_engine_openvg.c @ 605:a8fa4c550fe5 openvg

use O_ALLOC() to make code clear
author Thinker K.F. Li <thinker@branda.to>
date Sun, 04 Jul 2010 15:39:12 +0800
parents 38514a7c6b26
children e21eb54c7d9c
comparison
equal deleted inserted replaced
604:38514a7c6b26 605:a8fa4c550fe5
262 return NULL; 262 return NULL;
263 263
264 egl_surface = eglCreateWindowSurface(egl_disp, config, drawable, 264 egl_surface = eglCreateWindowSurface(egl_disp, config, drawable,
265 attrib_list); 265 attrib_list);
266 266
267 surface = (mbe_surface_t *)malloc(sizeof(mbe_surface_t)); 267 surface = O_ALLOC(mbe_surface_t);
268 if(surface == NULL) { 268 if(surface == NULL) {
269 eglDestroySurface(egl_disp, egl_surface); 269 eglDestroySurface(egl_disp, egl_surface);
270 return NULL; 270 return NULL;
271 } 271 }
272 272
302 */ 302 */
303 surface = eglCreatePbufferSurface(display, config, attrib_list); 303 surface = eglCreatePbufferSurface(display, config, attrib_list);
304 if(surface == EGL_NO_SURFACE) 304 if(surface == EGL_NO_SURFACE)
305 return NULL; 305 return NULL;
306 306
307 mbe_surface = (mbe_surface_t *)malloc(sizeof(mbe_surface_t)); 307 mbe_surface = O_ALLOC(mbe_surface_t);
308 if(mbe_surface == NULL) { 308 if(mbe_surface == NULL) {
309 eglDestroySurface(display, surface); 309 eglDestroySurface(display, surface);
310 return NULL; 310 return NULL;
311 } 311 }
312 mbe_surface->surface = surface; 312 mbe_surface->surface = surface;
336 if(path == VG_INVALID_HANDLE) { 336 if(path == VG_INVALID_HANDLE) {
337 eglDestroyContext(display, ctx); 337 eglDestroyContext(display, ctx);
338 return NULL; 338 return NULL;
339 } 339 }
340 340
341 canvas = (mbe_t *)malloc(sizeof(mbe_t)); 341 canvas = O_ALLOC(mbe_t);
342 if(canvas == NULL) { 342 if(canvas == NULL) {
343 eglDestroyContext(display, ctx); 343 eglDestroyContext(display, ctx);
344 vgDestroyPath(path); 344 vgDestroyPath(path);
345 return NULL; 345 return NULL;
346 } 346 }