commit
8646f2f8a3
7 changed files with 32 additions and 21 deletions
|
@ -107,14 +107,11 @@ void Fluid::init(float sampleRate)
|
|||
Fluid::~Fluid()
|
||||
{
|
||||
_state = FLUID_SYNTH_STOPPED;
|
||||
foreach(Voice* v, activeVoices)
|
||||
delete v;
|
||||
foreach(Voice* v, freeVoices)
|
||||
delete v;
|
||||
foreach(SFont* sf, sfonts)
|
||||
delete sf;
|
||||
foreach(Channel* c, channel)
|
||||
delete c;
|
||||
qDeleteAll(activeVoices);
|
||||
qDeleteAll(freeVoices);
|
||||
qDeleteAll(sfonts);
|
||||
qDeleteAll(channel);
|
||||
qDeleteAll(patches);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
|
@ -2644,8 +2644,10 @@ static QPixmap createThumbnail(const QString& name)
|
|||
{
|
||||
MasterScore* score = new MasterScore;
|
||||
Score::FileError error = readScore(score, name, true);
|
||||
if (error != Score::FileError::FILE_NO_ERROR)
|
||||
if (error != Score::FileError::FILE_NO_ERROR) {
|
||||
delete score;
|
||||
return QPixmap();
|
||||
}
|
||||
score->doLayout();
|
||||
QImage pm = score->createThumbnail();
|
||||
delete score;
|
||||
|
|
|
@ -2286,15 +2286,18 @@ void loadTranslation(QString filename, QString localeName)
|
|||
QFile::remove(userlp + ".qm");
|
||||
}
|
||||
|
||||
if (MScore::debugMode) qDebug("load translator <%s>", qPrintable(lp));
|
||||
if (MScore::debugMode)
|
||||
qDebug("load translator <%s>", qPrintable(lp));
|
||||
bool success = translator->load(lp);
|
||||
if (!success && MScore::debugMode) {
|
||||
qDebug("load translator <%s> failed", qPrintable(lp));
|
||||
}
|
||||
if(success) {
|
||||
if (success) {
|
||||
qApp->installTranslator(translator);
|
||||
translatorList.append(translator);
|
||||
}
|
||||
else {
|
||||
if (MScore::debugMode)
|
||||
qDebug("load translator <%s> failed", qPrintable(lp));
|
||||
delete translator;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
|
@ -8835,9 +8835,9 @@ QIcon MgStyle::getCachedIcon(QString key) const
|
|||
if (pixmap)
|
||||
return QIcon(*pixmap);
|
||||
else {
|
||||
QIcon* icon = new QIcon(new MIconEngine);
|
||||
icon->addFile(key);
|
||||
QPixmapCache::insert(key, icon->pixmap(48));
|
||||
return *icon;
|
||||
QIcon icon = QIcon(new MIconEngine);
|
||||
icon.addFile(key);
|
||||
QPixmapCache::insert(key, icon.pixmap(48));
|
||||
return icon;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,8 +86,11 @@ MasterSynthesizer::~MasterSynthesizer()
|
|||
{
|
||||
for (Synthesizer* s : _synthesizer)
|
||||
delete s;
|
||||
for (int i = 0; i < MAX_EFFECTS; ++i)
|
||||
delete _effect[i];
|
||||
for (int i = 0; i < MAX_EFFECTS; ++i) {
|
||||
for (Effect* e : _effectList[i])
|
||||
delete e;
|
||||
// delete _effect[i]; // _effect takes from _effectList
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
|
@ -74,6 +74,8 @@ Zerberus::~Zerberus()
|
|||
globalInstruments.erase(it);
|
||||
}
|
||||
}
|
||||
for (Channel* c : _channel)
|
||||
delete c;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
#include "synthesizer/synthesizer.h"
|
||||
#include "synthesizer/event.h"
|
||||
#include "voice.h"
|
||||
|
||||
class Voice;
|
||||
class Channel;
|
||||
class ZInstrument;
|
||||
enum class Trigger : char;
|
||||
|
@ -44,6 +44,10 @@ class VoiceFifo {
|
|||
VoiceFifo() {
|
||||
n = 0;
|
||||
}
|
||||
~VoiceFifo() {
|
||||
for (Voice* v : buffer)
|
||||
delete v;
|
||||
}
|
||||
void push(Voice* v) {
|
||||
buffer[writeIdx++] = v;
|
||||
writeIdx %= MAX_VOICES;
|
||||
|
|
Loading…
Reference in a new issue