directfb: Initialize m_dfb after DirectFBInit has been called

The QDirectFBIntegration is responsibe for deleting the DirectFB
instance but it can only initialize the DirectFB instance after
the DirectFBInit has been called. Change the order. This issue
got introduced by myself in 3faa89f4.

Change-Id: Ia67d439152d895e2e0a47f35eed57348c629f79f
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
This commit is contained in:
Holger Hans Peter Freyther 2011-09-25 19:31:02 +02:00 committed by Qt by Nokia
parent 500dc2a6f8
commit 91e99d1420

View File

@ -79,8 +79,7 @@ QDirectFbScreen::QDirectFbScreen(int display)
} }
QDirectFbIntegration::QDirectFbIntegration() QDirectFbIntegration::QDirectFbIntegration()
: m_dfb(QDirectFbConvenience::dfbInterface()) : m_fontDb(new QGenericUnixFontDatabase())
, m_fontDb(new QGenericUnixFontDatabase())
, m_eventDispatcher(createUnixEventDispatcher()) , m_eventDispatcher(createUnixEventDispatcher())
{ {
QGuiApplicationPrivate::instance()->setEventDispatcher(m_eventDispatcher); QGuiApplicationPrivate::instance()->setEventDispatcher(m_eventDispatcher);
@ -102,6 +101,9 @@ QDirectFbIntegration::QDirectFbIntegration()
delete[] argv[i]; delete[] argv[i];
delete[] argv; delete[] argv;
// This must happen after DirectFBInit.
m_dfb.reset(QDirectFbConvenience::dfbInterface());
m_primaryScreen.reset(new QDirectFbScreen(0)); m_primaryScreen.reset(new QDirectFbScreen(0));
screenAdded(m_primaryScreen.data()); screenAdded(m_primaryScreen.data());