Closing Tux Paint before the end of font scanning resulted in crashes in the Android port.
This commit is contained in:
parent
ba19100fb9
commit
bcc3bdda96
3 changed files with 14 additions and 0 deletions
|
|
@ -82,7 +82,11 @@ void loadfont_callback(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer
|
||||||
{
|
{
|
||||||
dirlen = dirlen;
|
dirlen = dirlen;
|
||||||
|
|
||||||
|
#ifndef FORKED_FONTS && #defined __ANDROID__
|
||||||
|
while (i-- && !font_thread_aborted)
|
||||||
|
#else
|
||||||
while (i--)
|
while (i--)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
int loadable = 0;
|
int loadable = 0;
|
||||||
const char *restrict const cp = strchr(files[i].str, '.');
|
const char *restrict const cp = strchr(files[i].str, '.');
|
||||||
|
|
|
||||||
|
|
@ -1519,7 +1519,11 @@ int charset_works(TuxPaint_Font * font, const char *s)
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
#ifndef FORKED_FONTS && #defined __ANDROID__
|
||||||
|
while (*s && !font_thread_aborted)
|
||||||
|
#else
|
||||||
while (*s)
|
while (*s)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
char c[8];
|
char c[8];
|
||||||
unsigned offset = 0;
|
unsigned offset = 0;
|
||||||
|
|
|
||||||
|
|
@ -5779,6 +5779,12 @@ static void mainloop(void)
|
||||||
SDL_Delay(1);
|
SDL_Delay(1);
|
||||||
}
|
}
|
||||||
while (!done);
|
while (!done);
|
||||||
|
#ifndef FORKED_FONTS && #defined __ANDROID__
|
||||||
|
/* Closing Tux Paint before the end of font scanning resulted in crashes in the Android port */
|
||||||
|
/* This is an abuse of font_thread_aborted, maybe it is better to use a new, more descriptive marker? */
|
||||||
|
if(!font_thread_done)
|
||||||
|
font_thread_aborted = 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue