Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ini_file_name does not increase ref count? #230

Closed
pedohorse opened this issue Apr 27, 2021 · 2 comments
Closed

ini_file_name does not increase ref count? #230

pedohorse opened this issue Apr 27, 2021 · 2 comments

Comments

@pedohorse
Copy link

that is my guess.
the thing is if you specify some runtime generated value to ini_file_name, and to nothing else - the resulting value on ini_file_name will be some random jibberish

io.ini_file_name = 'imgui.ini'.encode()

this will result in either no ini file created, or, most likely for me, a filename with random ascii codes in name created

but if you just do this

some_persistent_var = 'imgui.ini'.encode()
io.ini_file_name = some_persistent_var

then all is good

so clearly python's garbage collector seem to not be aware of that reference from imgui

@learn-more
Copy link
Collaborator

this is a const char* on imgui's side, so imgui is indeed expecting the other side to keep it valid.
same problem with the LogFilename

learn-more added a commit to learn-more/pyimgui that referenced this issue May 7, 2021
Dear ImGui expects these to be kept alive
pyimgui#230
@learn-more
Copy link
Collaborator

@KinoxKlark this should now be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants