eelias Posted January 7, 2014 Posted January 7, 2014 Hi there! I am not sure if I am doing right with datamodules. I am following the demos and implemented the folloging in my code: function DMMainG: TDMMainG; begin Result := TDMMainG(UniMainModule.GetModuleInstance(TDMMainG)); end; So, I add my unit with the datamodule and then i use the above function to get the valid instance of the it. However I am lost, WHAT IS THE REASON of doing this way? On the destructor of my Form I am not not doing FREE on the datamodule. Because if I do so, the next time it is instantiated it do not works correctly: I use DBISAM and the Database and Session components does not get created and the datamodule fails. Then I am writing the application always never doing FREE on the datamodule, and always calling that GetModuleInstace. I would like to know what is this way, is that is correct, because I am getting some instabilities on the application and I am not sure if this is the reason. Thank you !!! Eduardo Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.