Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2014-02-06 19:14:58 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-02-06 19:14:58 +0400
commit10b82471f4bbe052506c6e0b1b7902cbdc0886c5 (patch)
tree7f3e664d424753ffc1b172004b93875463bb4e52 /source/blender/makesrna/intern/rna_ui.c
parente8e32db3be888b4bdba2405b15d1718e45ffd1c4 (diff)
Fix T38515: python menu tooltip description affecting unrelated menus.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui.c')
-rw-r--r--source/blender/makesrna/intern/rna_ui.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index c36becf7276..c812fa0f167 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -677,7 +677,6 @@ static void rna_Menu_unregister(Main *UNUSED(bmain), StructRNA *type)
WM_main_add_notifier(NC_WINDOW, NULL);
}
-static char _menu_descr[RNA_DYN_DESCR_MAX];
static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data, const char *identifier,
StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
@@ -687,14 +686,13 @@ static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data
int have_function[2];
size_t over_alloc = 0; /* warning, if this becomes a bess, we better do another alloc */
size_t description_size = 0;
+ char _menu_descr[RNA_DYN_DESCR_MAX] = {0};
/* setup dummy menu & menu type to store static properties in */
dummymenu.type = &dummymt;
dummymenu.type->description = _menu_descr;
RNA_pointer_create(NULL, &RNA_Menu, &dummymenu, &dummymtr);
- /* clear in case they are left unset */
- _menu_descr[0] = '\0';
/* We have to set default context! Else we get a void string... */
strcpy(dummymt.translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA);
@@ -727,6 +725,8 @@ static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data
memcpy(buf, _menu_descr, description_size);
mt->description = buf;
}
+ else
+ mt->description = "";
mt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, mt->idname, &RNA_Menu);
RNA_def_struct_translation_context(mt->ext.srna, mt->translation_context);