Comments (9)
@rh101
I added your text on the Wiki page:
https://github.com/axmolengine/axmol/wiki/Extensions#extension-specific-notes
from axmol.
The ImGui implementation for Android was a test implementation to try and see if ImGui would work on that platform, since it was previously limited to desktop (Windows/OpenGL). The input handling in the Android implementation of ImGui may also not be working correctly, so there is little point in using it on that platform for the time being.
It would be best to disable ImGui if you're building a project (including cpp-tests) for Android, at least until all these issues with the Android ImGui implementation are addressed.
from axmol.
@halx99
Please add helpdesk or wiki
from axmol.
I've been trying to get Axmol and Android Studio working this afternoon, and when I compile the
CppTests
project, I notice that the app crashes immediately if I try to conduct an Autotest, or when I leave the ImGui tests.
Out of curiosity, for what reason are you running the Auto Test function? If you're new to Axmol, and you're looking to learn more about it, then just be aware that the Auto Test is not for that purpose.
from axmol.
I've been trying to get Axmol and Android Studio working this afternoon, and when I compile the
CppTests
project, I notice that the app crashes immediately if I try to conduct an Autotest, or when I leave the ImGui tests.Out of curiosity, for what reason are you running the Auto Test function? If you're new to Axmol, and you're looking to learn more about it, then just be aware that the Auto Test is not for that purpose.
I was just tryin' make sure that everything works absolutely fine. I was playing with cocos2d this morning and found that it sucks... dependency hell. That's when I somehow spotted Axmol in some issue in their repository.
from axmol.
PR #1920 will fix the ImGui crash on Android, but as for the possible memory leak, that will require more investigation.
from axmol.
To my surprise, the way that this piece of code does resource de-allocation astonishes me: it simply sets pointers from
struct ImGuiIO
toNULL
. This is, to my knowledge, not in accordance with standard C++ coding practices to the very least.
io.BackendPlatformUserData
and io.BackendRendererUserData
both hold the same pointer, which is the value returned from ImGui_ImplAndroid_GetBackendData();
, and that pointer is deleted, as you can see at the end of the ImGui_ImplAndroid_Shutdown()
function:
void ImGui_ImplAndroid_Shutdown()
{
ImGui_ImplAndroid_Data* bd = ImGui_ImplAndroid_GetBackendData();
...
io.BackendPlatformUserData = NULL;
io.BackendRendererUserData = NULL;
IM_DELETE(bd);
...
}
The pointer is an instance of ImGui_ImplAndroid_Data
, which does not inherit from ax::Object
/ax::Ref
, so it has nothing to do with the reference tracking in Axmol. This means anything you see from AX_REF_LEAK_DETECTION
is not from the allocation of ImGui_ImplAndroid_Data
, but perhaps something else linked to it, or entirely unrelated to it.
The only object that is retained is the EventListenerTouchOneByOne
, but that is also correctly released correctly in the ImGui_ImplAndroid_Shutdown()
function.
from axmol.
io.BackendPlatformUserData
andio.BackendRendererUserData
both hold the same pointer, which is the value returned fromImGui_ImplAndroid_GetBackendData();
, and that pointer is deleted, as you can see at the end of theImGui_ImplAndroid_Shutdown()
function:void ImGui_ImplAndroid_Shutdown() { ImGui_ImplAndroid_Data* bd = ImGui_ImplAndroid_GetBackendData(); ... io.BackendPlatformUserData = NULL; io.BackendRendererUserData = NULL; IM_DELETE(bd); ... }
Yeah I see, but as far as I knows what IM_DELETE
does is simply calls on the destructor (in this case there's none) and then frees the memory via library call. Not sure whether there're objects leaked in this process… I haven't fully investigated whether all classes of objects pointed to inside the ImGui_ImplAndroid_Data
are indeed inherited from ax::Ref
and are placed on the autorelease list
from axmol.
Yeah I see, but as far as I knows what
IM_DELETE
does is simply calls on the destructor (in this case there's none) and then frees the memory via library call. Not sure whether there're objects leaked in this process…
The ImGui_ImplAndroid_Data
is being freed correctly.
I haven't fully investigated whether all classes of objects pointed to inside the
ImGui_ImplAndroid_Data
are indeed inherited fromax::Ref
and are placed on the autorelease list
Autorelease doesn't actually have anything to do with this, and there may be some misunderstanding as to what its purpose is. Just in case, we do have a wiki article explaining the reference counting model used in Axmol, along with a section on autorelease, which you can find here.
from axmol.
Related Issues (20)
- MediaPlayer Video not correctly rendered for Android 11 and older devices
- [ImGui] Invalid texture data drawn on modal popups HOT 1
- ArchLinux setup dependencies always fail
- VolatileTextureMgr::addImage memory leak HOT 1
- HttpClient释放response指针异常
- FontFreeType performance issues on Android HOT 2
- UITest.json source HOT 3
- Node:getChildren()性能问题 HOT 6
- Unknow function "setTargetFlags" & "ax::RenderTargetFlag" in Live2D extensions
- Font Issue with Emojis & Emoticons HOT 2
- TextureCache::addImage should be return when textures found.
- checkReallySupportsASTC does not work on ios device HOT 6
- Can't add package to XCode project HOT 8
- 执行csb文件,打开界面慢 HOT 8
- MediaPlayer Video not correctly rendered for Android (Galaxy S22 Ultra)
- Incorrect output when using custom shaders HOT 6
- Incorrect child widget positions when using normalized positioning HOT 6
- `Sprite::setPolygonInfo()` doesn't set content size HOT 4
- The MediaPlayer controller widgets position incorrect after commit 4011 HOT 6
- Android - Wrong FPS/update on high rate devices HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axmol.