From 38647faa5a6cecd87ed36f8e5660fc5462f38bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C5=82odzimierz=20Skiba?= Date: Tue, 17 May 2005 18:29:31 +0000 Subject: [PATCH] Possible crash fix from Ryan (patch #1194315). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34107 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/mediactrlcmn.cpp | 40 ++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/common/mediactrlcmn.cpp b/src/common/mediactrlcmn.cpp index fa89291316..c72a70ede3 100644 --- a/src/common/mediactrlcmn.cpp +++ b/src/common/mediactrlcmn.cpp @@ -60,6 +60,16 @@ DEFINE_EVENT_TYPE(wxEVT_MEDIA_STOP); // //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +//--------------------------------------------------------------------------- +// wxMediaBackend Destructor +// +// This is here because the DARWIN gcc compiler badly screwed up and +// needs the destructor implementation in the source +//--------------------------------------------------------------------------- +wxMediaBackend::~wxMediaBackend() +{ +} + //--------------------------------------------------------------------------- // wxMediaCtrl::Create (file version) // wxMediaCtrl::Create (URL version) @@ -84,8 +94,10 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id, { if(!szBackend.empty()) { - if(!DoCreate(wxClassInfo::FindClass(szBackend), parent, id, - pos, size, style, validator, name)) + wxClassInfo* pClassInfo = wxClassInfo::FindClass(szBackend); + + if(!pClassInfo || !DoCreate(pClassInfo, parent, id, + pos, size, style, validator, name)) { m_imp = NULL; return false; @@ -139,18 +151,19 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id, } bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id, - const wxURI& location, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& szBackend, - const wxValidator& validator, - const wxString& name) + const wxURI& location, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& szBackend, + const wxValidator& validator, + const wxString& name) { if(!szBackend.empty()) { - if(!DoCreate(wxClassInfo::FindClass(szBackend), parent, id, - pos, size, style, validator, name)) + wxClassInfo* pClassInfo = wxClassInfo::FindClass(szBackend); + if(!pClassInfo || !DoCreate(pClassInfo, parent, id, + pos, size, style, validator, name)) { m_imp = NULL; return false; @@ -363,7 +376,6 @@ wxFileOffset wxMediaCtrl::Seek(wxFileOffset where, wxSeekMode mode) wxFileOffset wxMediaCtrl::Tell() { - //FIXME if(m_imp && m_bLoaded) return (wxFileOffset) m_imp->GetPosition().ToLong(); return wxInvalidOffset; @@ -371,7 +383,6 @@ wxFileOffset wxMediaCtrl::Tell() wxFileOffset wxMediaCtrl::Length() { - //FIXME if(m_imp && m_bLoaded) return (wxFileOffset) m_imp->GetDuration().ToLong(); return wxInvalidOffset; @@ -407,9 +418,6 @@ void wxMediaCtrl::DoMoveWindow(int x, int y, int w, int h) m_imp->Move(x, y, w, h); } -//DARWIN gcc compiler badly screwed up - needs destructor impl in source -wxMediaBackend::~wxMediaBackend() -{ } #include "wx/html/forcelnk.h" FORCE_LINK(basewxmediabackends);