Skip to content

Commit

Permalink
Fix sigabrt/sigsegv on shutdown
Browse files Browse the repository at this point in the history
Reenable call to growlight_stop() in shutdown_cycle() of
growlight. Fix bug in adapter_free() where we needed to
check for NULL prev/next on the circular list.

Closes #106.
  • Loading branch information
dankamongmen committed Nov 17, 2020
1 parent 899881d commit f257abe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ with `v` to see full details about the adapter (along with other information):
│sda: Samsung SSD 8502B6Q (465.76GiB) S/N: S2RANX0H729580X WC+ WRV- RO- │
│Sectors: 976773168 (512B logical / 512B physical) SAT3 (6Gbps) │
│Partitioning: gpt I/O scheduler: [mq-deadline] none │
│ 512MiB P₀ 2048→1050623 sda1 (unnamed) ef00 1MiB align │
│ 512MiB P₀ 2048→1050623 sda1 (unnamed) ef00 1MiB align
│ 510.98MiB vfat “GRIMESESP” at /boot/efi │
╰─────────────────────────────────────────────────────────────────────────╯
</pre>
Expand Down
12 changes: 6 additions & 6 deletions src/notcurses/notcurses.c
Original file line number Diff line number Diff line change
Expand Up @@ -5865,13 +5865,13 @@ static void
adapter_free(void *cv){
adapterstate *as = cv;
lock_notcurses_growlight();
as->prev->next = as->next;
as->next->prev = as->prev;
if(as->prev){
as->prev->next = as->next;
as->next->prev = as->prev;
}
if(as->rb){
ncreel_del(PR, as->rb);
}
as->next->prev = as->prev;
as->prev->next = as->next;
free_adapter_state(as); // clears subentries
--count_adapters;
draw_main_window(notcurses_stdplane(NC)); // Update the device count
Expand All @@ -5892,12 +5892,12 @@ shutdown_cycle(void){

diag("User-initiated shutdown\n");
ps = show_splash(L"Shutting down...");
/*if(growlight_stop()){
if(growlight_stop()){
kill_splash(ps);
notcurses_stop(NC);
dump_diags();
exit(EXIT_FAILURE);
} FIXME */
}
kill_splash(ps);
if(notcurses_stop(NC)){
dump_diags();
Expand Down

0 comments on commit f257abe

Please sign in to comment.