EnumProperty with ENUM_FLAG and item callback crashes on click #38489

Closed
opened 2014-02-04 19:55:56 +01:00 by CodeManX · 4 comments
Member

System Information
Windows 7, 64bit

Blender Version
Broken: 6852184 (2014-02-03, master modified)
Worked: 2.69 official (at least no crash)

Short description of error
A dynamically populated EnumProperty (items <- func) with ENUM_FLAG for multi-select crashes on click. No crash in 2.69 but:
Memoryblock free: pointer not in memlist

Exact steps for others to reproduce the error
Run attached script in 2.69 official, and see Object tab panel at the bottom. Select an object type and see how the second dropdown reacts (may clear label on change, although the property value doesn't change??)

Run it with a recent build, click on it and see it crashing.

The second property is not related to the crash. No crash with static enum items.

dynamic_enum_multiselect_enum_flag.py

**System Information** Windows 7, 64bit **Blender Version** Broken: 6852184 (2014-02-03, master modified) Worked: 2.69 official (at least no crash) **Short description of error** A dynamically populated EnumProperty (items <- func) with ENUM_FLAG for multi-select crashes on click. No crash in 2.69 but: `Memoryblock free: pointer not in memlist` **Exact steps for others to reproduce the error** Run attached script in 2.69 official, and see Object tab panel at the bottom. Select an object type and see how the second dropdown reacts (may clear label on change, although the property value doesn't change??) Run it with a recent build, click on it and see it crashing. The second property is not related to the crash. No crash with static enum items. [dynamic_enum_multiselect_enum_flag.py](https://archive.blender.org/developer/F76002/dynamic_enum_multiselect_enum_flag.py)
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @CodeManX

Added subscriber: @CodeManX

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Campbell Barton self-assigned this 2014-02-05 13:13:05 +01:00

Fixed the incorrect memfree, however the script still crashes, this is a known problem with dynamic defined items.

A workaround is to store the return value from items_prop1 somewhere. eg:

  def items_prop1(self, context):
      types = {ob.type: ob.type for ob in context.scene.objects}
      items_prop1.ret = [(t, t, "") for t in types]
      return items_prop1.ret
Fixed the incorrect memfree, however the script still crashes, this is a known problem with dynamic defined items. A workaround is to store the return value from `items_prop1` somewhere. eg: ``` def items_prop1(self, context): types = {ob.type: ob.type for ob in context.scene.objects} items_prop1.ret = [(t, t, "") for t in types] return items_prop1.ret
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#38489
No description provided.