fix SubtitleProvider initialization order

Originally committed to SVN as r368.
This commit is contained in:
David Lamparter 2006-05-06 02:41:50 +00:00
parent 24f889af56
commit 77545ee654
2 changed files with 6 additions and 4 deletions

View file

@ -39,15 +39,17 @@
#include "subtitle_provider.h"
std::map<wxString, SubtitleProvider::Class *> SubtitleProvider::Class::classes;
std::map<wxString, SubtitleProvider::Class *> *SubtitleProvider::Class::classes = NULL;
SubtitleProvider::Class::Class(wxString name)
{
classes.insert(std::make_pair(name, this));
if (!classes)
classes = new std::map<wxString, SubtitleProvider::Class *>();
(*classes)[name] = this;
}
SubtitleProvider *SubtitleProvider::Class::GetProvider(wxString provider_name, AssFile *subs)
{
return classes[provider_name]->Get(subs);
return (*classes)[provider_name]->Get(subs);
}

View file

@ -71,7 +71,7 @@ public:
// };
class Class {
private:
static std::map<wxString, SubtitleProvider::Class *> classes;
static std::map<wxString, SubtitleProvider::Class *> *classes;
public:
Class(wxString name);