Scott,
I believe I found a little problem. My understanding is as follows: using the method GetDeviceFromDescription a new CDevice instance will be created. This class is initialized passing the value for m_szDeviceName from pHB_GetDeviceInfoFromDescription. So far ok. But the m_szDeviceDescription will be initialized with the value originally passed by GetDeviceFromDescription. This could be a temporary memory. Instead of this, the szDeviceDescription should be initialized with a persistent value gathered from the server or it should get new own memory.
Can you confirm this?
peter
little issue in plugin API
Re: little issue in plugin API
Yes I can. You are right that it could be problematic to use temporary memory for the Device description passed to GetDeviceFromDescription().peter wrote:Can you confirm this?
I typically only use that call to create a temporary CDevice object and then delete it after completing whatever needed to be done. If you need to keep the CDevice around for a while, make sure you use a variable for the description that will be around for the life of the object.
Good catch, but I probably won't change the API at this time since there is a workaround.
Scott