Commit 7acae74b authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Manually delete ImportController to ensure libvlc instance is the last thing destroyed.

parent e78e3889
......@@ -162,6 +162,7 @@ SET (VLMC_HDRS
Gui/wizard/WelcomePage.h
Gui/WorkflowFileRendererDialog.h
Library/Library.h
LibVLCpp/VLCInstance.h
LibVLCpp/VLCMediaPlayer.h
Media/Clip.h
Media/Media.h
......
......@@ -84,6 +84,9 @@ MainWindow::MainWindow( QWidget *parent ) :
//We only install message handler here cause it uses configuration.
VlmcDebug::getInstance()->setup();
//VLC Instance:
LibVLCpp::Instance::getInstance( this );
// GUI
DockWidgetManager::instance( this )->setMainWindow( this );
initializeDockWidgets();
......@@ -145,7 +148,7 @@ MainWindow::~MainWindow()
if ( m_fileRenderer )
delete m_fileRenderer;
LibVLCpp::Instance::destroyInstance();
delete m_importController;
}
void MainWindow::changeEvent( QEvent *e )
......@@ -166,7 +169,7 @@ void MainWindow::setupLibrary()
//GUI part :
MediaLibraryWidget* mediaLibraryWidget = new MediaLibraryWidget( this );
m_importController = new ImportController( this );
m_importController = new ImportController();
DockWidgetManager::instance()->addDockedWidget( mediaLibraryWidget,
tr( "Media Library" ),
......
......@@ -117,6 +117,7 @@ ImportController::ImportController(QWidget *parent) :
ImportController::~ImportController()
{
delete m_preview;
delete m_ui;
delete m_stackNav;
delete m_tag;
......
......@@ -25,7 +25,7 @@
using namespace LibVLCpp;
Instance::Instance()
Instance::Instance( QObject* parent /*= NULL*/ ) : QObject( parent )
{
char const *argv[] =
{
......
......@@ -24,23 +24,27 @@
#define VLCINSTANCE_H
#include "VLCpp.hpp"
#include "Singleton.hpp"
#include "QSingleton.hpp"
#include <QObject>
struct libvlc_instance_t;
namespace LibVLCpp
{
class Instance : public Internal< libvlc_instance_t >,
public Singleton<Instance>
class Instance : public QObject,
public Internal< libvlc_instance_t >,
public QSingleton<Instance>
{
Q_OBJECT
private:
Instance();
Instance( QObject* parent = NULL );
Instance( int argc, const char** argv );
~Instance();
private:
friend class Singleton<Instance>;
friend class QSingleton<Instance>;
};
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment