Comments (11)
Thanks for reporting this issue!
Could you help me figure out how to reproduce this?
from ftxui.
Are you making one component to contain itself as a children?
from ftxui.
Here is the repro.
With x64-Debug preset, typing "exit" and pressing enter results in the crash.
from ftxui.
Thanks! I will take a look.
from ftxui.
but things seems to work.
Maybe this is Windows only. In this case, there are some chances this is fixe by:
18d1b04
from ftxui.
Hey @MichaelGoulding,
I landed a few patches. Since I can't reproduce your problem, it is quite hard for me to fix. However I have good hope it might be fixed (~10% probability). Could you please check whether this has been fixed on the latest patch?
from ftxui.
With this example:
{
auto cmdInput = Input(&g_currentCmdString, "enter command");
auto layout = Container::Vertical({
cmdInput,
});
}
The layout class is destroyed before the cmdInput class, so the parent pointer points to bogus memory in cmdInput.
cmdInput's Detach() method then tries to remove itself from the parent's children list in its destructor, leading to a crash in Window's Debug mode.
MSVC catches this in Debug mode because the memory for layout appears to be set to a known bad value after destruction.
You might be able to reproduce this with AddressSanitizer on Linux.
I think the fix might be to use a weak_ptr for the parent object so that you know if the parent is already destroyed, or you can have the parent component detach all its children on destruction.
from ftxui.
Indeed!
This is very weird this got unnoticed for so long!
Could you confirm this has been fixed by latest patch?
from ftxui.
See my comments for #117
from ftxui.
See my comments for #117
Fixed! Thanks!
Do you see any other issues?
from ftxui.
not right now. thanks!
from ftxui.
Related Issues (20)
- Is there a way to change the Slider 's color? HOT 1
- [doc-bug] Move Documentation Comments From `.cpp` To `.hpp` For Better LSP Support HOT 1
- Slider Bug; 3 line but only 1 line valid HOT 2
- cursor problem HOT 1
- Allow Canvas re-use for optimization HOT 3
- container is passed to renderer as a lambda return value, causing rendering to fail HOT 5
- How to remove focus from an element when hovering with the mouse pointer? HOT 2
- Run-Time Check Failure: Stack Corruption of 'option' Variable HOT 5
- Adding elements in loop HOT 1
- [HELP] - Menu inside frame goes to the top when unfocused HOT 3
- Problems with `Menu`? HOT 2
- When moving the mouse inside the application, a sequence of control characters of the terminal appears. HOT 7
- Improper exiting with signals
- how to make Dropdown without border HOT 1
- when will release new version HOT 4
- Simulate a timeline HOT 2
- dropdown example bugs HOT 2
- Creating an input window, and outputting entered text after hitting enter or special key. HOT 3
- how to hide the cursor HOT 2
- About Support for Full width Characters in FTXUI 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 ftxui.