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_file.h"
#include "utils.h"
AssExportFilter::AssExportFilter(wxString const& name, wxString const& description, int priority)
: name(name)
@ -93,3 +94,7 @@ FilterList *AssExportFilterChain::GetFilterList() {
static FilterList instance;
return &instance;
}
void AssExportFilterChain::Clear() {
delete_clear(*GetFilterList());
}

View File

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

View File

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