mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

IMG files are not properly unloaded after resource stopped

Open Xenius97 opened this issue 2 years ago • 6 comments

Describe the bug

If you stop the resource, and try to modify file with script or program you will get an error message another program is using it.

Steps to reproduce

load img, then stop the resource

this should fix it, but does currently nothing:

addEventHandler("onClientResourceStop", resourceRoot, function()
	if img then
		engineRemoveImage(img)
	end
end)

Version

Multi Theft Auto v1.6-release-21834

Additional context

No response

Relevant log output

No response

Security Policy

  • [X] I have read and understood the Security Policy and this issue is not security related.

Xenius97 avatar Jun 10 '23 19:06 Xenius97

Still an issue, not fixed, please can you reopen?

Xenius97 avatar Jan 17 '24 12:01 Xenius97

Same WTR?

TheNormalnij avatar Jan 17 '24 15:01 TheNormalnij

img files are protected after disconnect/resource stop, if u restart the resource you will get a kick by HTTP server file mismatch or script will fail to load, cannot modify/delete file until MTA gets stopped

Xenius97 avatar Jan 17 '24 15:01 Xenius97

@TheNormalnij Is it possible that the CClientIMGManager or CCLientIMG isn't destroyed? Remember that we have an open file for reading the img. Perhaps we should close it? And reopen each time the user wants to get a file's content?

Pirulax avatar Jan 17 '24 16:01 Pirulax

[2024-01-17 16:27:29] WARNING: [mods]\exs_modloader\modloader_c.lua:58: Operation failed @ 'fileDelete' [@cache//_cache_269203]

Xenius97 avatar Jan 17 '24 17:01 Xenius97

Still an issue, not fixed yet.

[2024-04-16 10:05:46] WARNING: [mods]\ez_modloader\client\main.lua:58: Operation failed @ 'fileDelete' [@cache//_cache_398908]
[2024-04-16 10:05:46] WARNING: [mods]\ez_modloader\client\main.lua:58: Operation failed @ 'fileDelete' [@cache//_cache_381833]

Xenius97 avatar Apr 16 '24 08:04 Xenius97