Delete built in export filters on exit

Originally committed to SVN as r5474.
This commit is contained in:
Thomas Goyne 2011-07-15 17:36:26 +00:00
parent faecc3304d
commit be8d841577
3 changed files with 10 additions and 4 deletions

View file

@ -42,6 +42,7 @@
#include "ass_export_filter.h" #include "ass_export_filter.h"
#include "ass_file.h" #include "ass_file.h"
#include "utils.h"
AssExportFilter::AssExportFilter(wxString const& name, wxString const& description, int priority) AssExportFilter::AssExportFilter(wxString const& name, wxString const& description, int priority)
: name(name) : name(name)
@ -93,3 +94,7 @@ FilterList *AssExportFilterChain::GetFilterList() {
static FilterList instance; static FilterList instance;
return &instance; return &instance;
} }
void AssExportFilterChain::Clear() {
delete_clear(*GetFilterList());
}

View file

@ -60,17 +60,15 @@ typedef std::list<AssExportFilter*> FilterList;
class AssExportFilterChain { class AssExportFilterChain {
friend class AssExporter; friend class AssExporter;
/// The list of registered filters
FilterList Filters;
/// Get the singleton instance /// Get the singleton instance
static FilterList *GetFilterList(); static FilterList *GetFilterList();
AssExportFilterChain() { }
public: public:
/// Register an export filter /// Register an export filter
static void Register(AssExportFilter *filter); static void Register(AssExportFilter *filter);
/// Unregister an export filter; must have been registered /// Unregister an export filter; must have been registered
static void Unregister(AssExportFilter *filter); static void Unregister(AssExportFilter *filter);
/// Unregister and delete all export filters
static void Clear();
}; };
/// DOCME /// DOCME

View file

@ -339,6 +339,9 @@ int AegisubApp::OnExit() {
#ifdef WITH_AUTOMATION #ifdef WITH_AUTOMATION
delete global_scripts; delete global_scripts;
#endif #endif
AssExportFilterChain::Clear();
#ifdef _DEBUG #ifdef _DEBUG
delete emit_stdout; delete emit_stdout;
#endif #endif