src/video/emscripten/SDL_emscriptenmouse.c
changeset 9298 98279bdf2230
parent 9278 8900afb78a19
child 9619 b94b6d0bff0f
equal deleted inserted replaced
9297:b4c74c050628 9298:98279bdf2230
    40     Emscripten_CursorData *curdata;
    40     Emscripten_CursorData *curdata;
    41 
    41 
    42     cursor = SDL_calloc(1, sizeof(SDL_Cursor));
    42     cursor = SDL_calloc(1, sizeof(SDL_Cursor));
    43     if (cursor) {
    43     if (cursor) {
    44         curdata = (Emscripten_CursorData *) SDL_calloc(1, sizeof(*curdata));
    44         curdata = (Emscripten_CursorData *) SDL_calloc(1, sizeof(*curdata));
       
    45         if (!curdata) {
       
    46             SDL_OutOfMemory();
       
    47             SDL_free(cursor);
       
    48             return NULL;
       
    49         }
    45 
    50 
    46         curdata->system_cursor = "default";
    51         curdata->system_cursor = "default";
    47         cursor->driverdata = curdata;
    52         cursor->driverdata = curdata;
    48     }
    53     }
    49     else {
    54     else {
   106             SDL_assert(0);
   111             SDL_assert(0);
   107             return NULL;
   112             return NULL;
   108     }
   113     }
   109 
   114 
   110     cursor = (SDL_Cursor *) SDL_calloc(1, sizeof(*cursor));
   115     cursor = (SDL_Cursor *) SDL_calloc(1, sizeof(*cursor));
       
   116     if (!cursor) {
       
   117         SDL_OutOfMemory();
       
   118         return NULL;
       
   119     }
   111     curdata = (Emscripten_CursorData *) SDL_calloc(1, sizeof(*curdata));
   120     curdata = (Emscripten_CursorData *) SDL_calloc(1, sizeof(*curdata));
       
   121     if (!curdata) {
       
   122         SDL_OutOfMemory();
       
   123         SDL_free(cursor);
       
   124         return NULL;
       
   125     }
   112 
   126 
   113     curdata->system_cursor = cursor_name;
   127     curdata->system_cursor = cursor_name;
   114     cursor->driverdata = curdata;
   128     cursor->driverdata = curdata;
   115 
   129 
   116     return cursor;
   130     return cursor;