Possible crash fix from Ryan (patch #1194315).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34107 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-05-17 18:29:31 +00:00
parent 878094ac7c
commit 38647faa5a

View File

@@ -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 (file version)
// wxMediaCtrl::Create (URL version) // wxMediaCtrl::Create (URL version)
@@ -84,8 +94,10 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id,
{ {
if(!szBackend.empty()) if(!szBackend.empty())
{ {
if(!DoCreate(wxClassInfo::FindClass(szBackend), parent, id, wxClassInfo* pClassInfo = wxClassInfo::FindClass(szBackend);
pos, size, style, validator, name))
if(!pClassInfo || !DoCreate(pClassInfo, parent, id,
pos, size, style, validator, name))
{ {
m_imp = NULL; m_imp = NULL;
return false; return false;
@@ -139,18 +151,19 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id,
} }
bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id, bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id,
const wxURI& location, const wxURI& location,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, const wxSize& size,
long style, long style,
const wxString& szBackend, const wxString& szBackend,
const wxValidator& validator, const wxValidator& validator,
const wxString& name) const wxString& name)
{ {
if(!szBackend.empty()) if(!szBackend.empty())
{ {
if(!DoCreate(wxClassInfo::FindClass(szBackend), parent, id, wxClassInfo* pClassInfo = wxClassInfo::FindClass(szBackend);
pos, size, style, validator, name)) if(!pClassInfo || !DoCreate(pClassInfo, parent, id,
pos, size, style, validator, name))
{ {
m_imp = NULL; m_imp = NULL;
return false; return false;
@@ -363,7 +376,6 @@ wxFileOffset wxMediaCtrl::Seek(wxFileOffset where, wxSeekMode mode)
wxFileOffset wxMediaCtrl::Tell() wxFileOffset wxMediaCtrl::Tell()
{ {
//FIXME
if(m_imp && m_bLoaded) if(m_imp && m_bLoaded)
return (wxFileOffset) m_imp->GetPosition().ToLong(); return (wxFileOffset) m_imp->GetPosition().ToLong();
return wxInvalidOffset; return wxInvalidOffset;
@@ -371,7 +383,6 @@ wxFileOffset wxMediaCtrl::Tell()
wxFileOffset wxMediaCtrl::Length() wxFileOffset wxMediaCtrl::Length()
{ {
//FIXME
if(m_imp && m_bLoaded) if(m_imp && m_bLoaded)
return (wxFileOffset) m_imp->GetDuration().ToLong(); return (wxFileOffset) m_imp->GetDuration().ToLong();
return wxInvalidOffset; return wxInvalidOffset;
@@ -407,9 +418,6 @@ void wxMediaCtrl::DoMoveWindow(int x, int y, int w, int h)
m_imp->Move(x, y, w, 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" #include "wx/html/forcelnk.h"
FORCE_LINK(basewxmediabackends); FORCE_LINK(basewxmediabackends);