Merge pull request #254 from coderobe/patch-1

Fix segfault in sdl1_2 demo
This commit is contained in:
Micha Mettke 2016-11-06 11:36:25 +01:00 committed by GitHub
commit a24f3f6bca
1 changed files with 1 additions and 1 deletions

View File

@ -367,7 +367,7 @@ nk_sdl_get_text_width(nk_handle handle, float height, const char *text, int len)
NK_API struct nk_context*
nk_sdl_init(SDL_Surface *screen_surface)
{
struct nk_user_font font;
static struct nk_user_font font;
sdl_font = (nk_sdl_Font*)calloc(1, sizeof(nk_sdl_Font));
sdl_font->width = 8; /* Default in the SDL_gfx library */
sdl_font->height = 8; /* Default in the SDL_gfx library */