Fix T37543: Multiline 3D Text saved in edit mode breaks on load

This commit is contained in:
2013-11-21 04:32:28 +11:00
parent 0af52adac0
commit d232486b40
5 changed files with 6 additions and 9 deletions

View File

@@ -116,6 +116,8 @@ void BKE_curve_editfont_free(Curve *cu)
MEM_freeN(ef);
cu->editfont = NULL;
}
MEM_SAFE_FREE(cu->selboxes);
}
void BKE_curve_editNurb_keyIndex_free(EditNurb *editnurb)

View File

@@ -3360,6 +3360,8 @@ static void lib_link_curve(FileData *fd, Main *main)
cu->ipo = newlibadr_us(fd, cu->id.lib, cu->ipo); // XXX deprecated - old animation system
cu->key = newlibadr_us(fd, cu->id.lib, cu->key);
cu->selboxes = NULL; /* runtime, clear */
cu->id.flag -= LIB_NEED_LINK;
}

View File

@@ -1475,13 +1475,6 @@ void load_editText(Object *obedit)
memcpy(cu->strinfo, ef->textbufinfo, (cu->len) * sizeof(CharInfo));
cu->len = strlen(cu->str);
/* this memory system is weak... */
if (cu->selboxes) {
MEM_freeN(cu->selboxes);
cu->selboxes = NULL;
}
}
void free_editText(Object *obedit)

View File

@@ -351,7 +351,7 @@ static bool ED_object_editmode_load_ex(Object *obedit, const bool freedata)
load_editNurb(obedit);
if (freedata) free_editNurb(obedit);
}
else if (obedit->type == OB_FONT && freedata) {
else if (obedit->type == OB_FONT) {
load_editText(obedit);
if (freedata) free_editText(obedit);
}

View File

@@ -223,7 +223,7 @@ typedef struct Curve {
float linewidth;
char *str;
struct SelBox *selboxes;
struct SelBox *selboxes; /* runtime variable for drawing selections (editmode data) */
struct EditFont *editfont;
char family[24];