Jump to content

[SOLVED] Somthing about property


photo

Recommended Posts

Posted

Hi,

 

Recently I used property class to store the properties of object, here I got three questions that confusing me:

 

1) Does engine.properties.clear(string library will remove the library and free the memory used by the library and all its contents? or just remove the reference?

2) Does engine.properties.removeProperty(string namewill remove the property and children from library and free all the memory they used? or just remove the reference?

3) Does Property clone(string namewill create a cloned property and placed it in the same library that original property was in?

 

I want know if I clear the library and reload it from file (may be for reset), will the memory will increase?

 

Could some one help me to clarify these questions? Thanks a lot!

 

 

Posted

Hello!

 

1) Does engine.properties.clear(string library will remove the library and free the memory used by the library and all its contents? or just remove the reference?

2) Does engine.properties.removeProperty(string namewill remove the property and children from library and free all the memory they used? or just remove the reference?

Used memory should be cleared, but not immediately. Please, check this memory managment article: https://developer.unigine.com/en/docs/1.0/scripting/language/features#memory
 

3) Does Property clone(string name) will create a cloned property and placed it in the same library that original property was in?

Property clone() returns the Property class instance.

 

I want know if I clear the library and reload it from file (may be for reset), will the memory will increase?

It depends on your code. Garbage collector eventually will free all the memory without references. 

 

If you have any issues with property libraries loading/unloading, please send us minimal test scene for reproduction. 

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

×
×
  • Create New...