Commit a673c49db80fc6218d1268d49b3bb50ea882393a
1 parent
0064b8b3
cheap fix to br_get_filename
Showing
1 changed file
with
3 additions
and
4 deletions
openbr/openbr.cpp
| @@ -382,10 +382,9 @@ bool br_img_is_empty(br_template tmpl) | @@ -382,10 +382,9 @@ bool br_img_is_empty(br_template tmpl) | ||
| 382 | 382 | ||
| 383 | const char* br_get_filename(br_template tmpl) | 383 | const char* br_get_filename(br_template tmpl) |
| 384 | { | 384 | { |
| 385 | - Template *t = reinterpret_cast<Template*>(tmpl); | ||
| 386 | - QByteArray s = t->file.name.toLocal8Bit(); | ||
| 387 | - char *buffer = s.data(); | ||
| 388 | - return buffer; | 385 | + static QByteArray buffer; |
| 386 | + buffer = reinterpret_cast<Template*>(tmpl)->file.name.toLocal8Bit(); | ||
| 387 | + return buffer.data(); | ||
| 389 | } | 388 | } |
| 390 | 389 | ||
| 391 | void br_set_filename(br_template tmpl, const char *filename) | 390 | void br_set_filename(br_template tmpl, const char *filename) |