I haven’t taken a look yet, I’ll try to do it today
EDIT: I think I’ve found the issue, a fix is on the way
I haven’t taken a look yet, I’ll try to do it today
EDIT: I think I’ve found the issue, a fix is on the way
We’ve pushed two fixes to the beta, and will be available for testing within an hour:
Yes, this is a bug. We will fix that.
Great, thanks!
Some of leaks fixed.
This is fixed.
mesh.buffer_res = resource.create_buffer("/def-mesh/buffers/buffer" .. RES_BUFFER_IDX .. ".bufferc", { buffer = buf, transfer_ownership = true })
This not. No transfer_ownership?
Creation
local name = "/runtime_buffer_water_" .. M.water.idx .. ".bufferc"
local new_buffer = resource.create_buffer(name, { buffer = water_create_default_native_buffer() })
later when change buffer
resource.set_buffer(e.water_buffer.buffer, buffer, { transfer_ownership = true })
But now sometimes i see leaked, sometime not.
When i change location(delete old water, create new water)
i see leaked. But every time it different. Sometimes i not see any leaks. Sometimes part of buffer leaks.
ERROR:RESOURCE: Leaked resources:
ERROR:RESOURCE: Resource: /runtime_buffer_water_5.bufferc ref count: 1
ERROR:RESOURCE: Resource: /runtime_buffer_water_1.bufferc ref count: 1
ERROR:RESOURCE: Resource: /runtime_buffer_water_2.bufferc ref count: 1
ERROR:RESOURCE: Resource: /runtime_buffer_water_3.bufferc ref count: 2
ERROR:RESOURCE: Resource: /runtime_buffer_water_4.bufferc ref count: 1
ERROR:RESOURCE: Leaked resources:
ERROR:RESOURCE: Resource: /runtime_buffer_water_5.bufferc ref count: 2
ERROR:RESOURCE: Resource: /runtime_buffer_water_4.bufferc ref count: 2
Do I need to do something specific to make the game create all of these? I just ran the project and closed it, and the two leaks originally posted were fixed. So I think I need more information on how to repro this. Or a smaller repro
1.This happened when i change location.
Look at video link.
1)Open game
2)Run in green rect. Stop.
3)Choose battle
4)Run back to lose
5)Return to hub location.
6)Close game
2.Add new code. So now it happened when you close game.
game_world.lua. Look at commit “add test to fix leaked”
--create 5 waters
local waters_test = {}
local FACTORY_URL = msg.url("game_scene:/factory#water")
local PARTS = {
ROOT = COMMON.HASHES.hash("/root"),
MESH = COMMON.HASHES.hash("/mesh"),
}
local function water_create_default_native_buffer()
return buffer.create(1, {
{ name = hash("position"), type = buffer.VALUE_TYPE_FLOAT32, count = 3 },
{ name = hash("normal"), type = buffer.VALUE_TYPE_FLOAT32, count = 3 },
{ name = hash("texcoord0"), type = buffer.VALUE_TYPE_FLOAT32, count = 2 },
})
end
for i = 1, 5 do
local e = { }
local collection = collectionfactory.create(FACTORY_URL, vmath.vector3(1))
local name = "/leaked buffer" .. i .. ".bufferc"
local new_buffer = resource.create_buffer(name, { buffer = water_create_default_native_buffer() })
e.water_buffer = {
name = name,
buffer = new_buffer
}
e.water_go = {
root = msg.url(assert(collection[PARTS.ROOT])),
mesh = nil
}
e.water_go.mesh = COMMON.LUME.url_component_from_url(e.water_go.root, "mesh")
-- assign cloned buffer to a mesh component
go.set(e.water_go.mesh, "vertices", e.water_buffer.buffer)
print("create water buffer", e.water_buffer.name)
table.insert(waters_test, e)
end
for _, w in ipairs(waters_test) do
print("delete water buffer", w.water_buffer.name)
assert(w.water_go)
go.delete(w.water_go.root, true)
w.water_go = nil
w.water_buffer = nil
end
collectgarbage("collect")
collectgarbage("collect")
collectgarbage("collect")
DEBUG:SCRIPT: [INFO 14:45:12] none: world/game/game_world.lua:97: create water buffer /leaked buffer1.bufferc
DEBUG:SCRIPT: [INFO 14:45:12] none: world/game/game_world.lua:97: create water buffer /leaked buffer2.bufferc
DEBUG:SCRIPT: [INFO 14:45:12] none: world/game/game_world.lua:97: create water buffer /leaked buffer3.bufferc
DEBUG:SCRIPT: [INFO 14:45:12] none: world/game/game_world.lua:97: create water buffer /leaked buffer4.bufferc
DEBUG:SCRIPT: [INFO 14:45:12] none: world/game/game_world.lua:97: create water buffer /leaked buffer5.bufferc
DEBUG:SCRIPT: [INFO 14:45:12] none: world/game/game_world.lua:102: delete water buffer /leaked buffer1.bufferc
DEBUG:SCRIPT: [INFO 14:45:12] none: world/game/game_world.lua:102: delete water buffer /leaked buffer2.bufferc
DEBUG:SCRIPT: [INFO 14:45:12] none: world/game/game_world.lua:102: delete water buffer /leaked buffer3.bufferc
DEBUG:SCRIPT: [INFO 14:45:12] none: world/game/game_world.lua:102: delete water buffer /leaked buffer4.bufferc
DEBUG:SCRIPT: [INFO 14:45:12] none: world/game/game_world.lua:102: delete water buffer /leaked buffer5.bufferc
DEBUG:SCRIPT: [INFO 14:45:12] GameSceneController: scenes/game/game_scene_controller.script:15: total level load:0.42450660000031
DEBUG:SCRIPT: [INFO 14:45:12] ContextManager: libs/contexts_manager.lua:86: Context register:GAME_GUI
DEBUG:SCRIPT: [INFO 14:45:12] ContextManager: libs/contexts_manager.lua:86: Context register:GAME_WORLD_GUI
DEBUG:SCRIPT: [INFO 14:45:12] Render: render/my.render_script:149: screen size changed. from w:1200 h:675 to w:1440 h:810
DEBUG:SCRIPT: [INFO 14:45:12] none: world/game/ecs/systems/draw_interact_aabb_system.lua:53: ZONE
DEBUG:SCRIPT: [INFO 14:45:12] SCENE: libs/sm/scene.lua:95: GameScene show
DEBUG:SCRIPT: [INFO 14:45:12] SCENE: libs/sm/scene.lua:115: GameScene resumed
DEBUG:SCRIPT: [INFO 14:45:13] ContextManager: libs/contexts_manager.lua:99: Context unregister:MAIN
DEBUG:SCRIPT: [INFO 14:45:13] ContextManager: libs/contexts_manager.lua:99: Context unregister:TOP_PANEL
DEBUG:SCRIPT: [INFO 14:45:13] ContextManager: libs/contexts_manager.lua:99: Context unregister:GAME
DEBUG:SCRIPT: [INFO 14:45:13] none: def-mesh/texture.lua:97: free texture:[/__anim_bones_Character.002_2.texturec]
DEBUG:SCRIPT: [INFO 14:45:13] ContextManager: libs/contexts_manager.lua:99: Context unregister:GAME_GUI
DEBUG:SCRIPT: [INFO 14:45:13] ContextManager: libs/contexts_manager.lua:99: Context unregister:GAME_WORLD_GUI
DEBUG:SCRIPT: [INFO 14:45:13] ContextManager: libs/contexts_manager.lua:99: Context unregister:LIVEUPDATE_COLLECTION
ERROR:RESOURCE: Leaked resources:
ERROR:RESOURCE: Resource: /leaked buffer5.bufferc ref count: 1
ERROR:RESOURCE: Resource: /leaked buffer4.bufferc ref count: 1
ERROR:RESOURCE: Resource: /leaked buffer3.bufferc ref count: 1
ERROR:RESOURCE: Resource: /leaked buffer2.bufferc ref count: 1
ERROR:RESOURCE: Resource: /leaked buffer1.bufferc ref count: 1
INFO:DLIB: SSDP: Done on address 192.168.0.102
INFO:DLIB: SSDP: Done on address 192.168.56.1
Got a fix for this, a new beta is building
The bug has been fixed; it is now building.
Updated beta is available now
I have tested it now and the new dimensions match correctly. I noticed two things:
Assertion failed: area > 1.192092896e-07F, file ..\src\box2d\Box2D\Collision\Shapes\b2PolygonShape.cpp, line 361
when exiting the application after setting the width or height to zero. I guess this is not a problem since setting the dimensions to zero doesn’t make much sense.Yes, I think it’s not comparable with Allow Dynamic Transforms
option.
It’s not critical, because this value isn’t valid. We will add a Lua error for it, but maybe in the next version
if @d954mas is happy with the fix, then I think we’ll happy too, and will continue with the stable release?
I am happy)
All errors fixed. Worked stable)
Thanks!
Hello how are you?
I just resumed my internship with Defold after a while, however I noticed that they started asking me for an update every time I open the editor, is this normal?
PS. I use KDENeon as OS, I did a hard reset to my pc.
I apologize in advance if this was not the topic to express my doubts.
Could you please share an editor log?
Also, which version of Defold are you using?
Britzl, I read the information you suggest me , thank you for your prompt help.
P.S. Version 1.6.4 was released a few minutes ago.
I think we will fix both in the next version