Fix for bug #17961: crash with material copy/past and GLSL.
This commit is contained in:
parent
4977609832
commit
2e610b3fb2
@ -77,6 +77,8 @@
|
||||
#include "MEM_guardedalloc.h"
|
||||
#include "BLI_blenlib.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
|
||||
#include "blendef.h"
|
||||
#include "mydevice.h"
|
||||
#include "butspace.h"
|
||||
@ -168,6 +170,7 @@ void do_buts_buttons(short event)
|
||||
}
|
||||
matcopybuf.nodetree= ntreeCopyTree(ma->nodetree, 0);
|
||||
matcopybuf.preview= NULL;
|
||||
matcopybuf.gpumaterial.first= matcopybuf.gpumaterial.last= NULL;
|
||||
matcopied= 1;
|
||||
}
|
||||
break;
|
||||
@ -189,6 +192,8 @@ void do_buts_buttons(short event)
|
||||
MEM_freeN(ma->nodetree);
|
||||
}
|
||||
|
||||
GPU_materials_free(ma);
|
||||
|
||||
id= (ma->id);
|
||||
memcpy(ma, &matcopybuf, sizeof(Material));
|
||||
(ma->id)= id;
|
||||
|
Loading…
Reference in New Issue
Block a user