A bug in PropertyPanel?


#1

Hi there;

I have a PropertyPanel and two different sets of PropertyComponent Array<>s. I want to display the related set of properties upon the users’ choice. However i get an acces violation when switching between sets. Actually the error occures when switching back to the set that has been set before.

Here is a code fragment that produces the violation:

PropertyPanel m_PropertiesPanel;
Array<PropertyComponent *> m_MulticastProperties;

m_PropertiesPanel.addProperties(m_MulticastProperties);
m_PropertiesPanel.clear();
m_PropertiesPanel.addProperties(m_MulticastProperties); // Crashes...

Thanks for the consideration.


#2

well yes… if you read the comments for addProperties(), you’ll see that it takes ownership of the objects you give it, so it’ll be deleting them when you clear it.


#3

Ok;

Thank you for the reply jules.

I will use a different Panel for each of my set then.


#4

No need to do that - you could just create some new property objects and pass those in. That’s the way I’d expect it to be used.


#5