![]() |
How to destruct libraries/models from CI base class? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: How to destruct libraries/models from CI base class? (/showthread.php?tid=67564) |
How to destruct libraries/models from CI base class? - Zelf - 03-09-2017 How can I destruct a library/model that has been loaded by the CI base class, from the CI base class? I want to keep the CI super object alive, but destroy a library/model that has been loaded. This is for memory reasons on a worker/consumer that runs forever. PHP Code: public function worker() { RE: How to destruct libraries/models from CI base class? - Zelf - 03-09-2017 This is what I came up with, if any CI developers are free to comment, please let me know why this isn't working. The issue is on a new loop after the library and model are destroyed, they do not load again. I'll get a "Call to member function on null" error. PHP Code: class Unloader extends CI_Loader { |