master
mouse-demo
dankamongmen/mosaicworld
dankamongmen/unibilium
dankamongmen/octrees-for-victory
gh-pages
dankamongmen/windows-tester
dankamongmen/pile-drop-graphics
dankamongmen/DRMmeharder
dankamongmen/fbconscrollamatic
dankamongmen/iterm2complete
dankamongmen/linuxfbdumb
dankamongmen/rationalize-rgba
dankamongmen/thirdpass
dankamongmen/libsixel
dankamongmen/sixel-quantize
dankamongmen/sixel-speedup
dankamongmen/libvlc
dankamongmen/split-em-up
dankamongmen/ltr
dankamongmen/clock_nanosleep_portable
dankamongmen/xcb
github-action
dankamongmen/speedypainter
dankamongmen/slickgoose
dankamongmen/speedy-blend
v3.0.9
v3.0.8
v3.0.7
v3.0.6
v3.0.5
v3.0.4
v3.0.3
v3.0.2
v3.0.1
v3.0.0
v2.4.9
v2.4.8
v2.4.7
v2.4.6
v2.4.5
v2.4.4
v2.4.3
v2.4.2
v2.4.1
v2.4.0
v2.3.18
v2.3.17
v2.3.16
v2.3.15
v2.3.14
v2.3.13
v2.3.12
v2.3.11
v2.3.10
v2.3.9
v2.3.8
v2.3.7
v2.3.6
v2.3.5
v2.3.4
v2.3.3
v2.3.2
v2.3.1
v2.3.0
v2.2.11
v2.2.10
v2.2.9
v2.2.8
v2.2.7
v2.2.6
v2.2.5
v2.2.4
v2.2.3
v2.2.2
v2.2.1
v2.2.0
v2.1.8
v2.1.7
v2.1.5
v2.1.4
v2.1.3
v2.1.2
v2.1.1
v2.1.0
v2.0.12
v2.0.11
v2.0.10
v2.0.9
v2.0.8
v2.0.7
v2.0.4
v2.0.3
v2.0.2
v2.0.1
v2.0.0
v1.7.6
v1.7.5
v1.7.4
v1.7.3
v1.7.2
v1.7.1
v1.7.0
v1.6.20
v1.6.19
v1.6.17
v1.6.15
v1.6.12
v1.6.11
v1.6.10
v1.6.9
v1.6.6
v1.6.3
v1.6.1
v1.6.0
v1.5.3
v1.5.2
v1.5.1
v1.5.0
v1.4.5
v1.4.4.1
v1.4.3
v1.4.2.4
v1.4.2.3
v1.4.1
v1.4.0
v1.3.4
v1.3.3
v1.3.2
v1.3.1
v1.3.0
v1.2.9
v1.2.8
v1.2.7
v1.2.6
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.1.8
v1.1.7
v1.1.6
v1.1.5
v1.1.4
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.9
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.4.0
v0.3.0
v0.2.0
v0.1.0
v0.0.9
v1.6.18
${ noResults }
1 Commits (e8707e575d63df77519ff29fe8c5e7ec00db2c0d)
Author | SHA1 | Message | Date |
---|---|---|---|
|
a29bfe9c42 |
[C++] Deal with widgets grabbing full ownership of Panel
Fixes: https://github.com/dankamongmen/notcurses/issues/1009 Whenever a widget is created with its `*_create` function it currently claims full ownership of the passed panel, including its destruction. However, the C++ wrapper around the panel is not aware of this and will attempt to destroy the native panel in the destructor, leading to segfaults. Fix this by introduction of a `Widget` class which contains the logic to properly modify the `Panel` instance to not double-destroy the native panel. The solution is a bit fragile since the `Panel` instance is left intact (we can't free it for the user) in a state that's safe for the C++ wrapper, but calling any C function via the wrapper **will** pass a `NULL` pointer in the panel argument - therefore the C functions MUST be proofed against this. The proofing belongs in the C backend code since this protects also C and other language binding users from such abuse. The Widget class will first verify that the passed `Plane` instance hasn't already been "disowned" and will throw an exception to the effect if it was. Next, it will proceed to take over ownership of the native panel instance and mark the passed `Panel` as "invalid" (i.e. not owning any native panel instance anymore) The above changes require modification of `Panel` instances and so all the widget constructors taking `const*` or `const&` have been removed from widget classes. |
4 years ago |