Delta Engine
»
Support
»
UI
»
The screen couldn't be disposed correctly
Joined: 8/22/2011(UTC) Posts: 170 Location: Moscow
Thanks: 3 times Was thanked: 2 time(s) in 2 post(s)
|
How can I fix this warning? (0.9.1.6) Code:
Program: TD v0.9.1.0
Modules: Graphic=OpenTK, Input=Windows, Audio=OpenTK, Video=, Physics=
Start Time: 2011-12-27 22:00:19
Platform: Windows, 4 CPU Cores, 32 bit (on 64 bit OS), Windows NT 6.2.8102.0, Resolution: 800, 480, VS: 2, PS: 2
User: bfoxandroid (BFOX-PC)
06.383 Warning: The screen 'Screen (Name=<DynamicCreated>, Type=UIScreen)' couldn't be disposed correctly
at Delta.Scenes.Scene.Dispose()
at Delta.Engine.Dynamic.DynamicModule.o8NepGgpj2PFKVZH27(System.Object )
at Delta.Engine.Dynamic.DynamicModule.Dispose()
at Delta.Engine.Dynamic.DynamicModule.o8NepGgpj2PFKVZH27(System.Object )
at Delta.Engine.Dynamic.DynamicModule.Dispose()
C:\code\DeltaEngine\Graphics\OpenTK\OpenTKGraphic.cs(374,4): at Delta.Graphics.OpenTK.OpenTKGraphic.Dispose()
at Delta.Engine.Dynamic.DynamicModule.o8NepGgpj2PFKVZH27(System.Object )
at Delta.Engine.Dynamic.DynamicModule.Dispose()
at Delta.Engine.Application.Dispose()
at Delta.Platforms.Windows.WindowsApplication.WGiTAtGIwKhmoabM3Vk(System.Object )
at Delta.Platforms.Windows.WindowsApplication.Dispose()
at Delta.Engine.Application.y8p7XDHvCO5EuXSMyC(System.Object )
at Delta.Engine.Application.StartExecutionLoop()
at Delta.Platforms.Windows.WindowsApplication.injCmGG2d83pQsp0EEn(System.Object )
at Delta.Platforms.Windows.WindowsApplication.StartExecutionLoop()
at Delta.Engine.Application.Start(Delta.Engine.Dynamic.DynamicModule initialModule)
C:\code\DeltaEngine\Samples\TowerDefence\Program.cs(16,13): at TD.Program.Main()
[ Code:using Delta.Engine;
using Delta.Engine.Dynamic;
using Delta.Rendering.Basics.Materials;
using Delta.Scenes.UserInterfaces;
using Delta.Utilities.Datatypes;
namespace TD
{
public class Test2 : DynamicModule
{
private Screen _buttonScreen;
private Screen _buttonScreen2;
public Test2()
: base("Blocks Game", typeof (Application))
{
_buttonScreen = new Screen
{
Background = new Material2DColored(Color.DarkGrey),
};
_buttonScreen.Open();
}
public override void Run()
{
if (Time.CheckEvery(2))
{
if (_buttonScreen.IsOpened)
{
_buttonScreen2 = new Screen
{
Background = new Material2DColored(Color.White),
};
_buttonScreen2.Open();
_buttonScreen.Close();
}
else
{
_buttonScreen = new Screen
{
Background = new Material2DColored(Color.Brown),
};
_buttonScreen.Open();
_buttonScreen2.Close();
}
}
}
}
}
]
Code:
private static void Main()
{
Settings.Extra.IsFullscreen = false;
Application.Window.Resize(800,480);
Application.Start(new Test2());
}
test does not display an error
Code: [Test, Category("Visual")]
public static void CreateScreenWithButton()
{
// Create a screen
Screen buttonScreen = new Screen()
{
// and set the background we want to see
Background = new Material2DColored(Color.DarkGrey),
};
Screen buttonScreen2 = new Screen()
{
// and set the background we want to see
Background = new Material2DColored(Color.Red),
};
// Next create now our button
// before we can see it finally in our application
buttonScreen.Open();
Application.Start(delegate
{
if (Time.CheckEvery(2))
{
if (buttonScreen.IsOpened)
{
buttonScreen2 = new Screen()
{
// and set the background we want to see
Background = new Material2DColored(Color.White),
};
buttonScreen2.Open();
buttonScreen.Close();
}
else
{
buttonScreen = new Screen()
{
// and set the background we want to see
Background = new Material2DColored(Color.Brown),
};
buttonScreen.Open();
buttonScreen2.Close();
}
}
});
}
Edited by user Tuesday, December 27, 2011 8:25:21 PM(UTC)
| Reason: Not specified |
Russian game developer. Давайте делать игры в команде. Идет набор. |
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
Your code looks good, but I cannot figure out why this warning was put there. It does not seem to affect anything (except not removing that screen from the scene before disposing). I commented the extra check out and it seems to work just fine. Old code: Code:
screen.Dispose();
if (screens.Contains(screen) == false)
{
Log.Warning(
"The screen '" + screen + "' couldn't be disposed correctly");
removeIndex++;
} // if
So this should not happen in v0.9.2 anymore. I hope that helps.
|
|
|
|
Delta Engine
»
Support
»
UI
»
The screen couldn't be disposed correctly
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.