diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-30 19:33:28 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-30 19:33:28 +0400 |
commit | e5587217d52e700d597f1118cf9d135077d7ff0b (patch) | |
tree | a34088af5718f09bed357703d141dea303963c81 | |
parent | 2a614b04c147d4095e0ac9f64ed6b00a9925359f (diff) |
Fix #30016: cycles crash with compute device set to GPU but not GPU device
available.
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index dc4f3449c1b..bc7f446d815 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -377,10 +377,18 @@ static EnumPropertyItem *rna_userdef_compute_device_itemf(bContext *UNUSED(C), P CCLDeviceInfo *devices = CCL_compute_device_list(opencl); int a; - for(a = 0; devices[a].name; a++) { - tmp.value = devices[a].value; - tmp.identifier = devices[a].identifier; - tmp.name = devices[a].name; + if(devices) { + for(a = 0; devices[a].name; a++) { + tmp.value = devices[a].value; + tmp.identifier = devices[a].identifier; + tmp.name = devices[a].name; + RNA_enum_item_add(&item, &totitem, &tmp); + } + } + else { + tmp.value = 0; + tmp.name = "CPU"; + tmp.identifier = "CPU"; RNA_enum_item_add(&item, &totitem, &tmp); } } |