Commit graph

12 commits

Author SHA1 Message Date
f38b9420ac B252: keep closed textures valid until the engine is done with them
Windows: closeTexture hands the texture to UnregisterTexture's callback and
frees its frame buffers there; frames pushed after close are dropped. Without
"recycle" the object is kept for the process lifetime (the session may still
hold its pointer); an engine that shuts down keeps its open textures the same
way. A duplicate createTexture key gets -1, getTexturePtr of an unknown key 0.

macOS: closeTexture drops the frame and closes the texture to later frames;
only "recycle" removes it from the plugin.

Linux: the frame handed to the engine last is freed at that engine's next
copy_pixels or once the engine has shut down, not at close: from Flutter 3.32
the raster thread can still be uploading it.

Tests: windows/test/run_tests.sh (plain, --asan, --tsan) and
linux/test/run_tests.sh (plain, --asan).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 03:19:05 +09:00
fufesou
b91e1b2092
fix memory leak on macOS (#9)
Signed-off-by: fufesou <shuanglongchen@yeah.net>
2023-03-14 12:44:36 +08:00
fufesou
8d66a7c55e
Refact/stride align (#8)
* rename row_align_bytes  to stride_align

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* trivail changes

Signed-off-by: fufesou <shuanglongchen@yeah.net>

---------

Signed-off-by: fufesou <shuanglongchen@yeah.net>
2023-03-03 09:46:33 +08:00
fufesou
873919902e
Feat/row align bytes (#7)
* better bytes alignment

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* debug macos

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* debug linux

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* windows switch_rgba

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* better switch_rgba

Signed-off-by: fufesou <shuanglongchen@yeah.net>

---------

Signed-off-by: fufesou <shuanglongchen@yeah.net>
2023-03-03 09:30:05 +08:00
fufesou
044bb260d9
add stride_align for onRgba (#6)
Signed-off-by: fufesou <shuanglongchen@yeah.net>
2023-03-02 21:38:55 +08:00
Kingtous
4f059a9138 fix: macos ptr access 2023-02-19 23:22:40 -08:00
Kingtous
6fd900c479 feat: texture rgba interface 2023-02-19 19:14:48 -08:00
Kingtous
71e77ef3cf fix: metal issue on macos 2023-02-17 22:23:39 +08:00
Kingtous
0e16af448c opt: add doc for macOS 2023-02-17 01:52:16 -08:00
Kingtous
4221adb1cb feat: initial macos 2023-02-17 01:35:25 -08:00
Kingtous
1f012dffac add: macos impl 2023-02-17 00:55:21 -08:00
Kingtous
b2bd5910e7 feat: init repo 2023-02-16 15:03:12 +08:00