forked from mia/Aegisub
Fix some "leaks" of things that should actually be alive for the lifetime of the program to reduce noise.
Originally committed to SVN as r4574.
This commit is contained in:
parent
50d1b3ed2d
commit
cbf201ab86
4 changed files with 11 additions and 12 deletions
|
@ -18,10 +18,13 @@
|
|||
/// @brief Logging
|
||||
/// @ingroup libaegisub
|
||||
|
||||
|
||||
#ifndef AGI_PRE
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
#include "libaegisub/log.h"
|
||||
#include "libaegisub/mutex.h"
|
||||
#include "libaegisub/types.h"
|
||||
|
@ -31,7 +34,7 @@ namespace agi {
|
|||
namespace log {
|
||||
|
||||
/// Global log sink.
|
||||
LogSink *log = new LogSink();
|
||||
std::auto_ptr<LogSink> log(new LogSink());
|
||||
|
||||
/// Short Severity ID
|
||||
/// Keep this ordered the same as Severity
|
||||
|
|
|
@ -67,7 +67,7 @@ enum Severity {
|
|||
extern const char *Severity_ID;
|
||||
|
||||
/// Global log sink.
|
||||
extern LogSink *log;
|
||||
extern std::auto_ptr<LogSink> log;
|
||||
|
||||
/// Container to hold a single message
|
||||
struct SinkMessage {
|
||||
|
|
|
@ -34,9 +34,6 @@
|
|||
/// @ingroup export
|
||||
///
|
||||
|
||||
|
||||
///////////
|
||||
// Headers
|
||||
#include "config.h"
|
||||
|
||||
#include "ass_export_filter.h"
|
||||
|
@ -184,7 +181,7 @@ const wxString& AssExportFilter::GetDescription() const {
|
|||
|
||||
|
||||
/// DOCME
|
||||
AssExportFilterChain *AssExportFilterChain::instance=NULL;
|
||||
std::auto_ptr<AssExportFilterChain> AssExportFilterChain::instance;
|
||||
|
||||
|
||||
|
||||
|
@ -192,7 +189,7 @@ AssExportFilterChain *AssExportFilterChain::instance=NULL;
|
|||
/// @return
|
||||
///
|
||||
FilterList *AssExportFilterChain::GetFilterList() {
|
||||
if (instance == NULL) instance = new AssExportFilterChain();
|
||||
if (!instance.get()) instance.reset(new AssExportFilterChain());
|
||||
return &(instance->Filters);
|
||||
}
|
||||
|
||||
|
@ -202,7 +199,7 @@ FilterList *AssExportFilterChain::GetFilterList() {
|
|||
/// @return
|
||||
///
|
||||
FilterList *AssExportFilterChain::GetUnpreparedFilterList() {
|
||||
if (instance == NULL) instance = new AssExportFilterChain();
|
||||
if (!instance.get()) instance.reset(new AssExportFilterChain());
|
||||
return &(instance->Unprepared);
|
||||
}
|
||||
|
||||
|
@ -216,5 +213,3 @@ void AssExportFilterChain::PrepareFilters() {
|
|||
}
|
||||
instance->Unprepared.clear();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
// Headers
|
||||
#ifndef AGI_PRE
|
||||
#include <list>
|
||||
#include <memory>
|
||||
|
||||
#include <wx/string.h>
|
||||
#include <wx/window.h>
|
||||
|
@ -81,7 +82,7 @@ private:
|
|||
|
||||
|
||||
/// DOCME
|
||||
static AssExportFilterChain *instance;
|
||||
static std::auto_ptr<AssExportFilterChain> instance;
|
||||
static FilterList *GetFilterList();
|
||||
static FilterList *GetUnpreparedFilterList();
|
||||
|
||||
|
|
Loading…
Reference in a new issue