ketsuekiro / manialive

Automatically exported from code.google.com/p/manialive
GNU Lesser General Public License v3.0
0 stars 0 forks source link

ManiaLive\libraries\ManiaLive\Gui\Windowing\Windowhandler.php #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I edited a file to show echo's to see if manialive really disables windows.

Files edited:  Windowhandler.php

lines edited: 684-688.

Release 216 of manialive.

Open as a player 5 windows and minimize them right away. After all that is done 
disconnect from the server and the following will be shown.

[code]

Controls that have not been freed:
PHP Fatal error:  Access to undeclared static property: ManiaLive\Gui\Windowing\
Control::$controls in C:\tmn\ManiaLive\libraries\ManiaLive\Gui\Windowing\WindowH
andler.php on line 685
PHP Stack trace:
PHP   1. {main}() C:\tmn\ManiaLive\bootstrapper.php:0
PHP   2. ManiaLive\Application\AbstractApplication->run() C:\tmn\ManiaLive\boots
trapper.php:82
PHP   3. ManiaLive\DedicatedApi\Connection->executeCallbacks() C:\tmn\ManiaLive\
libraries\ManiaLive\Application\AbstractApplication.php:146
PHP   4. ManiaLive\Event\Dispatcher::dispatch() C:\tmn\ManiaLive\libraries\Mania
Live\DedicatedApi\Connection.php:108
PHP   5. ManiaLive\DedicatedApi\Callback\Event->fireDo() C:\tmn\ManiaLive\librar
ies\ManiaLive\Event\Dispatcher.php:52
PHP   6. call_user_func_array() C:\tmn\ManiaLive\libraries\ManiaLive\DedicatedAp
i\Callback\Event.php:28
PHP   7. ManiaLive\Gui\Windowing\WindowHandler->onPlayerDisconnect() C:\tmn\Mani
aLive\libraries\ManiaLive\DedicatedApi\Callback\Event.php:0

Fatal error: Access to undeclared static property: ManiaLive\Gui\Windowing\Contr
ol::$controls in C:\tmn\ManiaLive\libraries\ManiaLive\Gui\Windowing\WindowHandle
r.php on line 685

Call Stack:
    0.0005     352896   1. {main}() C:\tmn\ManiaLive\bootstrapper.php:0
    0.0270    2113424   2. ManiaLive\Application\AbstractApplication->run() C:\t
mn\ManiaLive\bootstrapper.php:82
   47.9346   18586664   3. ManiaLive\DedicatedApi\Connection->executeCallbacks()
 C:\tmn\ManiaLive\libraries\ManiaLive\Application\AbstractApplication.php:146
   47.9351   18587896   4. ManiaLive\Event\Dispatcher::dispatch() C:\tmn\ManiaLi
ve\libraries\ManiaLive\DedicatedApi\Connection.php:108
   47.9352   18588176   5. ManiaLive\DedicatedApi\Callback\Event->fireDo() C:\tm
n\ManiaLive\libraries\ManiaLive\Event\Dispatcher.php:52
   47.9352   18588488   6. call_user_func_array() C:\tmn\ManiaLive\libraries\Man
iaLive\DedicatedApi\Callback\Event.php:28
   47.9352   18588672   7. ManiaLive\Gui\Windowing\WindowHandler->onPlayerDiscon
nect() C:\tmn\ManiaLive\libraries\ManiaLive\DedicatedApi\Callback\Event.php:0

[/code]

This happens if a player opens up 5 windows and then leaves.

When editing an other line it will show that its being removed but its not 
being freed from memory.

Original issue reported on code.google.com by w1llaopgezwolle@gmail.com on 21 May 2011 at 8:19

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Can you tell me which version of ManiaLive you are running ?
And can you tell me which method is sending this message ?

Original comment by melot.philippe on 23 May 2011 at 9:51

GoogleCodeExporter commented 8 years ago
The version i run is 216 of manialive.

This is the total function of what i edited.

/**
     * (non-PHPdoc)
     * @see libraries/ManiaLive/DedicatedApi/Callback/ManiaLive\DedicatedApi\Callback.Listener::onPlayerDisconnect()
     */
    function onPlayerDisconnect($login)
    {
        // clear drawStack for that player
        unset(self::$drawStack[$login]);

        // free the dialog
        self::$dialogStack = array();

        // free managed windows ...
        unset(self::$currentManagedWindow[$login]);
        unset(self::$minimizedManagedWindowHashes[$login]);
        unset(self::$minimizedManagedWindows[$login]);

        // clean memory ...
        self::destroyPlayerWindows($login);
        gc_collect_cycles();

        //echo "Controls that have not been freed:\n";
        //foreach (Control::$controls as $control)
        //{
        //  echo "- " . $control . "\n";
        //}
    }

    /**
     * Removes all window resources that have been allocated
     * for the player.
     * @param string $login Players Login
     */
    static function destroyPlayerWindows($login)
    {
        echo "\nremoving player windows!\n";

        if (isset(Window::$instances[$login]))
        {
            foreach (Window::$instances[$login] as $window)
            {
                $window->destroy();
            }
            unset(Window::$instances[$login]);
        }

        if (isset(Window::$instancesNonSingleton[$login]))
        {
            foreach (Window::$instancesNonSingleton[$login] as $window)
            {
                $window->destroy();
            }
            unset(Window::$instancesNonSingleton[$login]);
        }
    }

Original comment by w1llaopgezwolle@gmail.com on 24 May 2011 at 1:08

GoogleCodeExporter commented 8 years ago
What have you done to be sure that some instances are still present in memory 
after having been released from the WindowHandler ?

Original comment by melot.philippe on 25 May 2011 at 2:24

GoogleCodeExporter commented 8 years ago
The following was loaded and gives me this...

This happened after leaving the server.

< unloading ManiaLive\Gui\Windowing\Windows\Shortkey
< unloading ManiaLivePlugins\MLEPP\AdminPanel\Gui\Windows\AdminPanelWindow
< unloading ManiaLivePlugins\MLEPP\ChallengeWidget\Gui\Windows\ChallengeWidgetWi
ndow
< unloading ManiaLivePlugins\MLEPP\DonateCoppers\Gui\DonatePanel
< unloading ManiaLivePlugins\MLEPP\Karma\Gui\Windows\KarmaWindow
< unloading ManiaLivePlugins\Flo\TMKarma\Gui\Windows\Widget
< unloading ManiaLivePlugins\MLEPP\TmxInfo\Gui\Windows\SimpleWindow
< unloading ManiaLivePlugins\MLEPP\AdminPanel\Gui\Windows\AdminWindow
< unloading ManiaLivePlugins\MLEPP\Jukebox\Gui\Windows\trackList
< unloading ManiaLivePlugins\MLEPP\ChatLog\Gui\Windows\ChatLogWindow
< unloading ManiaLivePlugins\MLEPP\Core\Gui\Windows\helpWindow
<< desctructing ManiaLive\Gui\Windowing\Windows\Shortkey
<< desctructing ManiaLivePlugins\MLEPP\AdminPanel\Gui\Windows\AdminPanelWindow
<< desctructing ManiaLivePlugins\MLEPP\ChallengeWidget\Gui\Windows\ChallengeWidg
etWindow
<< desctructing ManiaLivePlugins\MLEPP\Karma\Gui\Windows\KarmaWindow
<< desctructing ManiaLivePlugins\Flo\TMKarma\Gui\Windows\Widget
< unloading ManiaLive\Gui\Windowing\Windows\Thumbnail
<< desctructing ManiaLivePlugins\MLEPP\TmxInfo\Gui\Windows\SimpleWindow
< unloading ManiaLive\Gui\Windowing\Windows\Thumbnail
<< desctructing ManiaLivePlugins\MLEPP\AdminPanel\Gui\Windows\AdminWindow
< unloading ManiaLive\Gui\Windowing\Windows\Thumbnail
< unloading ManiaLive\Gui\Windowing\Windows\Thumbnail
<< desctructing ManiaLivePlugins\MLEPP\ChatLog\Gui\Windows\ChatLogWindow
< unloading ManiaLive\Gui\Windowing\Windows\Thumbnail
<< desctructing ManiaLivePlugins\MLEPP\Core\Gui\Windows\helpWindow
<< desctructing ManiaLive\Gui\Windowing\Windows\Thumbnail
<< desctructing ManiaLive\Gui\Windowing\Windows\Thumbnail
<< desctructing ManiaLive\Gui\Windowing\Windows\Thumbnail
<< desctructing ManiaLive\Gui\Windowing\Windows\Thumbnail
<< desctructing ManiaLive\Gui\Windowing\Windows\Thumbnail
<< desctructing ManiaLivePlugins\MLEPP\Jukebox\Gui\Windows\trackList
[18:23:24] [MLEPP] [JoinLeaveMessage] dccw1lla left the server.

Original comment by w1llaopgezwolle@gmail.com on 25 May 2011 at 4:24

GoogleCodeExporter commented 8 years ago

Original comment by melot.philippe on 31 Dec 2012 at 9:33