mirror of https://github.com/bjornbytes/lovr.git
Fix refcounting in lovr.data;
This commit is contained in:
parent
f0cac8fa69
commit
1b9f81b57f
|
@ -14,9 +14,9 @@ int l_lovrDataInit(lua_State* L) {
|
|||
int l_lovrDataNewTextureData(lua_State* L) {
|
||||
Blob* blob = luax_readblob(L, 1, "Texture");
|
||||
TextureData* textureData = lovrTextureDataFromBlob(blob);
|
||||
luax_pushtype(L, TextureData, textureData);
|
||||
lovrRelease(&blob->ref);
|
||||
lovrRelease(&textureData->ref);
|
||||
luax_pushtype(L, TextureData, textureData);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -24,9 +24,9 @@ int l_lovrDataNewAudioStream(lua_State* L) {
|
|||
Blob* blob = luax_readblob(L, 1, "Sound");
|
||||
size_t bufferSize = luaL_optinteger(L, 2, 4096);
|
||||
AudioStream* stream = lovrAudioStreamCreate(blob, bufferSize);
|
||||
luax_pushtype(L, AudioStream, stream);
|
||||
lovrRelease(&blob->ref);
|
||||
lovrRelease(&stream->ref);
|
||||
luax_pushtype(L, AudioStream, stream);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue