forked from mia/Aegisub
Fix memory leak when exporting a file fails
Originally committed to SVN as r4420.
This commit is contained in:
parent
f064624ecd
commit
ca24f60a7e
1 changed files with 5 additions and 8 deletions
|
@ -34,11 +34,12 @@
|
||||||
/// @ingroup export
|
/// @ingroup export
|
||||||
///
|
///
|
||||||
|
|
||||||
|
|
||||||
///////////
|
|
||||||
// Headers
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#ifndef AGI_PRE
|
||||||
|
#include <memory>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "ass_export_filter.h"
|
#include "ass_export_filter.h"
|
||||||
#include "ass_exporter.h"
|
#include "ass_exporter.h"
|
||||||
#include "ass_file.h"
|
#include "ass_file.h"
|
||||||
|
@ -169,12 +170,8 @@ AssFile *AssExporter::ExportTransform(wxWindow *export_dialog) {
|
||||||
/// @param export_dialog
|
/// @param export_dialog
|
||||||
///
|
///
|
||||||
void AssExporter::Export(wxString filename, wxString charset, wxWindow *export_dialog) {
|
void AssExporter::Export(wxString filename, wxString charset, wxWindow *export_dialog) {
|
||||||
// Get transformation
|
std::auto_ptr<AssFile> Subs(ExportTransform(export_dialog));
|
||||||
AssFile *Subs = ExportTransform(export_dialog);
|
|
||||||
|
|
||||||
// Save
|
|
||||||
Subs->Save(filename,false,false,charset);
|
Subs->Save(filename,false,false,charset);
|
||||||
delete Subs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue