Fixed crash with temp on linux and mac

This commit is contained in:
Allen Webster 2017-11-20 21:28:46 -05:00
parent 05a89b37e8
commit 9d54e76590
2 changed files with 7 additions and 8 deletions

View File

@ -514,6 +514,9 @@ Sys_Font_Path(name, parameters){
} }
} }
Partition *part = &shared_vars.font_scratch;
path.temp = begin_temp_memory(part);
b32 got_font = false; b32 got_font = false;
if (pattern_styled != 0){ if (pattern_styled != 0){
if (FcConfigSubstitute(fc_config, pattern_styled, FcMatchPattern)){ if (FcConfigSubstitute(fc_config, pattern_styled, FcMatchPattern)){
@ -526,8 +529,6 @@ Sys_Font_Path(name, parameters){
if (font != 0){ if (font != 0){
FcPatternGetString(font, FC_FILE, 0, &filename); FcPatternGetString(font, FC_FILE, 0, &filename);
if (filename != 0){ if (filename != 0){
Partition *part = &shared_vars.font_scratch;
path.temp = begin_temp_memory(part);
i32 len = str_size((char*)filename); i32 len = str_size((char*)filename);
char *buffer = push_array(part, char, len + 1); char *buffer = push_array(part, char, len + 1);
if (buffer == 0){ if (buffer == 0){
@ -563,8 +564,6 @@ Sys_Font_Path(name, parameters){
if (font != 0){ if (font != 0){
FcPatternGetString(font, FC_FILE, 0, &filename); FcPatternGetString(font, FC_FILE, 0, &filename);
if (filename != 0){ if (filename != 0){
Partition *part = &shared_vars.font_scratch;
path.temp = begin_temp_memory(part);
i32 len = str_size((char*)filename); i32 len = str_size((char*)filename);
char *buffer = push_array(part, char, len + 1); char *buffer = push_array(part, char, len + 1);
if (buffer == 0){ if (buffer == 0){

View File

@ -348,10 +348,10 @@ Sys_Font_Path(name, parameters){
OSX_Font_Match match = osx_get_font_match(name, pt_size, italic, bold); OSX_Font_Match match = osx_get_font_match(name, pt_size, italic, bold);
Font_Path path = {0}; Font_Path path = {0};
if (match.path != 0){
Partition *part = &shared_vars.font_scratch; Partition *part = &shared_vars.font_scratch;
path.temp = begin_temp_memory(part); path.temp = begin_temp_memory(part);
if (match.path != 0){
i32 len = str_size(match.path); i32 len = str_size(match.path);
char *buffer = push_array(part, char, len + 1); char *buffer = push_array(part, char, len + 1);
if (buffer == 0){ if (buffer == 0){