Replace more instances new/delete with owning types (#4245)
* Use owning types when possible. Note: the QByteArray s is detached to mimic previous behavior; detach() guarantees that the QByteArray uniquely owns its data, since otherwise it's COW. This may be relevant in case Plugin:instantiate modifies s.data() -- this way the original QString is safe. * Make m_filter a unique_ptr. * Make m_activeRenderer a unique_ptr * use std::string instead of strcpy + buffers
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#ifndef NOTE_PLAY_HANDLE_H
|
||||
#define NOTE_PLAY_HANDLE_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "AtomicInt.h"
|
||||
#include "BasicFilters.h"
|
||||
#include "Note.h"
|
||||
@@ -46,7 +48,7 @@ class EXPORT NotePlayHandle : public PlayHandle, public Note
|
||||
MM_OPERATORS
|
||||
public:
|
||||
void * m_pluginData;
|
||||
BasicFilters<> * m_filter;
|
||||
std::unique_ptr<BasicFilters<>> m_filter;
|
||||
|
||||
// specifies origin of NotePlayHandle
|
||||
enum Origins
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#ifndef RENDER_MANAGER_H
|
||||
#define RENDER_MANAGER_H
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
#include "ProjectRenderer.h"
|
||||
#include "OutputSettings.h"
|
||||
@@ -70,7 +70,7 @@ private:
|
||||
ProjectRenderer::ExportFileFormats m_format;
|
||||
QString m_outputPath;
|
||||
|
||||
ProjectRenderer* m_activeRenderer;
|
||||
std::unique_ptr<ProjectRenderer> m_activeRenderer;
|
||||
|
||||
QVector<Track*> m_tracksToRender;
|
||||
QVector<Track*> m_unmuted;
|
||||
|
||||
Reference in New Issue
Block a user