mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-02 09:40:15 +00:00
enforce singleton across both direct and rendered mode #1694
This commit is contained in:
parent
d170e6e7a2
commit
3ac445a328
4
NEWS.md
4
NEWS.md
@ -22,6 +22,10 @@ rearrangements of Notcurses.
|
||||
* Sadly, `ncplane_contents()` no longer accepts a `const ncplane*`, since it
|
||||
might write temporaries to the plane's EGCpool during operation.
|
||||
* Added `ncdirect_styles()`, to retrieve the current styling.
|
||||
* In previous versions of Notcurses, a rendered-mode context
|
||||
(`struct notcurses`) and a direct-mode context (`struct ncdirect`) could
|
||||
be open at the same time. This was never intended, and is no longer
|
||||
possible.
|
||||
|
||||
* 2.3.1 (2021-05-18)
|
||||
* Sprixels no longer interact with their associated plane's framebuffer. This
|
||||
|
@ -111,12 +111,10 @@ int setup_signals(void* vnc, bool no_quit_sigs, bool no_winch_sig,
|
||||
void* expected = NULL;
|
||||
struct sigaction sa;
|
||||
// don't register ourselves if we don't intend to set up signal handlers
|
||||
if(!no_winch_sig || !no_quit_sigs){
|
||||
// we expect NULL (nothing registered), and want to register nc
|
||||
if(!atomic_compare_exchange_strong(&signal_nc, &expected, nc)){
|
||||
loginfo(nc, "%p is already registered for signals (provided %p)\n", expected, nc);
|
||||
return -1;
|
||||
}
|
||||
// we expect NULL (nothing registered), and want to register nc
|
||||
if(!atomic_compare_exchange_strong(&signal_nc, &expected, nc)){
|
||||
loginfo(nc, "%p is already registered for signals (provided %p)\n", expected, nc);
|
||||
return -1;
|
||||
}
|
||||
if(!no_winch_sig){
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
|
Loading…
Reference in New Issue
Block a user