Text3d: error in own recent fix for thread safety
authorCampbell Barton <ideasman42@gmail.com>
Sun, 5 Jan 2014 09:00:03 +0000 (20:00 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 5 Jan 2014 10:15:24 +0000 (21:15 +1100)
source/blender/blenkernel/intern/font.c

index 222251f6e5ee36ae2560f8fbf7a84f37453625bb..0fddce5a9b366d1bf68f9e03ad769a0c89f1b826 100644 (file)
@@ -598,9 +598,21 @@ makebreak:
                }
 
                vfont = which_vfont(cu, info);
-               
+
                if (vfont == NULL) break;
 
+               if (vfont != oldvfont) {
+                       vfd = vfont_get_data(bmain, vfont);
+                       oldvfont = vfont;
+               }
+
+               /* VFont Data for VFont couldn't be found */
+               if (!vfd) {
+                       MEM_freeN(chartransdata);
+                       chartransdata = NULL;
+                       goto finally;
+               }
+
                if (!ELEM(ascii, '\n', '\0')) {
                        BLI_rw_mutex_lock(&vfont_rwlock, THREAD_LOCK_READ);
                        che = find_vfont_char(vfd, ascii);
@@ -629,25 +641,6 @@ makebreak:
                        che = NULL;
                }
 
-               /* No VFont found */
-               if (vfont == NULL) {
-                       MEM_freeN(chartransdata);
-                       chartransdata = NULL;
-                       goto finally;
-               }
-
-               if (vfont != oldvfont) {
-                       vfd = vfont_get_data(bmain, vfont);
-                       oldvfont = vfont;
-               }
-
-               /* VFont Data for VFont couldn't be found */
-               if (!vfd) {
-                       MEM_freeN(chartransdata);
-                       chartransdata = NULL;
-                       goto finally;
-               }
-
                twidth = char_width(cu, che, info);
 
                /* Calculate positions */