Fix T38516: crash when using color picker from redo panel.

This commit is contained in:
Brecht Van Lommel 2014-02-06 18:02:31 +01:00
parent 10b82471f4
commit e2541f87bc
Notes: blender-bot 2023-02-14 11:14:29 +01:00
Referenced by issue #38516, Changing the color twice in a script color picker causes a crash
2 changed files with 4 additions and 4 deletions

View File

@ -2299,7 +2299,7 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor
* would slow down redraw, so only lookup for actual transform when it's indeed
* needed
*/
block->display_device = scn->display_settings.display_device;
BLI_strncpy(block->display_device, scn->display_settings.display_device, sizeof(block->display_device));
/* copy to avoid crash when scene gets deleted with ui still open */
block->unit = MEM_mallocN(sizeof(scn->unit), "UI UnitSettings");

View File

@ -350,9 +350,9 @@ struct uiBlock {
bool color_profile; /* color profile for correcting linear colors for display */
const char *display_device; /* display device name used to display this block,
* used by color widgets to transform colors from/to scene linear
*/
char display_device[64]; /* display device name used to display this block,
* used by color widgets to transform colors from/to scene linear
*/
};
typedef struct uiSafetyRct {