I have the following questions regarding the DLL.CallFunction(), which are not mentioned in the documenttion:
Regarding 1)
Functions in our C++ DLL returns results in the form of a dynamically created "char*". Now the question is, who need to take responsibility for the memory allocated that is returned.
Does Setup Factory take ownership or is the responsibility of the DLL to keep track of the data and free it?
I accept that a memory leak is not really a problem since the memory will be cleaned up during the unload, but a 'double free' or 'reference after free' will be an issue if SetupFactory takes ownership.
Regarding 2)
For some reason our DLL does not get unloaded and after the install completes we still have a process called irsetup.exe in the task manager. We can see that the dll was not deleted and the irsetup.exe has a handle open to the DLL. We are suspecting an issue in our dll but just want to ensure that we are not doing anything wrong.
- Does Setup Factory take ownership of a string retuned from a dll when using the DLL.CallFunction() and specifying the return type as "DLL_RETURN_TYPE_STRING"?
- Is the DLL loaded and then immediately unloaded when called or when does the DLL get unloaded?
Regarding 1)
Functions in our C++ DLL returns results in the form of a dynamically created "char*". Now the question is, who need to take responsibility for the memory allocated that is returned.
Does Setup Factory take ownership or is the responsibility of the DLL to keep track of the data and free it?
I accept that a memory leak is not really a problem since the memory will be cleaned up during the unload, but a 'double free' or 'reference after free' will be an issue if SetupFactory takes ownership.
Regarding 2)
For some reason our DLL does not get unloaded and after the install completes we still have a process called irsetup.exe in the task manager. We can see that the dll was not deleted and the irsetup.exe has a handle open to the DLL. We are suspecting an issue in our dll but just want to ensure that we are not doing anything wrong.
Comment