Improved RenderWindow context creation

Former-commit-id: a744a433603e4f14ce6d7e7c269d5ff659b1a0f7
This commit is contained in:
Lynix 2014-04-26 12:58:07 +02:00
parent beb1879aca
commit b899ff294b
1 changed files with 14 additions and 14 deletions

View File

@ -286,15 +286,15 @@ bool NzRenderWindow::OnWindowCreated()
m_parameters.doubleBuffered = true;
m_parameters.window = GetHandle();
m_context = new NzContext;
if (!m_context->Create(m_parameters))
std::unique_ptr<NzContext> context(new NzContext);
if (!context->Create(m_parameters))
{
NazaraError("Failed not create context");
delete m_context;
return false;
}
m_context = context.release();
if (!SetActive(true)) // Les fenêtres s'activent à la création
NazaraWarning("Failed to activate window");