Ensure the rencache commands buffer is cleared on restart

Fix issue #176 but it should be tested more thoroughly.
This commit is contained in:
Francesco Abbate
2021-05-05 09:32:24 +02:00
parent 820d520fc3
commit d8244120e9
3 changed files with 11 additions and 0 deletions
+6
View File
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <SDL.h>
#include "api/api.h"
#include "rencache.h"
#include "renderer.h"
#ifdef _WIN32
@@ -158,6 +159,11 @@ init_lua:
enable_momentum_scroll();
#endif
/* We need to clear the rencache commands because we may restarting the application
and it could be non-empty. It is important to clear the command buffer because it
stores pointers to font_desc objects and these are Lua managed. */
rencache_clear();
const char *init_lite_code = \
"local core\n"
"xpcall(function()\n"