mirror of https://github.com/bjornbytes/lovr.git
Fix SoundData leaks;
This commit is contained in:
parent
2acc4761b7
commit
e5fd9c7412
|
@ -88,6 +88,7 @@ int l_lovrDataNewSoundData(lua_State* L) {
|
|||
int channelCount = luaL_optinteger(L, 4, 2);
|
||||
SoundData* soundData = lovrSoundDataCreate(samples, sampleRate, bitDepth, channelCount);
|
||||
luax_pushobject(L, soundData);
|
||||
lovrRelease(soundData);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -95,6 +96,7 @@ int l_lovrDataNewSoundData(lua_State* L) {
|
|||
if (audioStream) {
|
||||
SoundData* soundData = lovrSoundDataCreateFromAudioStream(audioStream);
|
||||
luax_pushobject(L, soundData);
|
||||
lovrRelease(soundData);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ int l_lovrMicrophoneGetData(lua_State* L) {
|
|||
Microphone* microphone = luax_checktype(L, 1, Microphone);
|
||||
SoundData* soundData = lovrMicrophoneGetData(microphone);
|
||||
luax_pushobject(L, soundData);
|
||||
lovrRelease(soundData);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue