Callback functions for shutdown()?
Nessuno ha ancora preso questa issue.
- Lingua principale
- C++
- Stelle
- 2.2k
- Fork
- 242
- Merge medio
- 11m
- PR unite (30g)
- 1
Descrizione
Hi, I encountered an issue that seems need some customization to the shutdown() function:
I have a separate thread initiated and detached before polyscope::init() -- a server listening from other software for sending geometries in.
The server use a shared_ptr<UIState> which is also used in the main().
Now if I close the main window of polyscope, there's always an error pointing to the ~shared_ptr<UIState>.
I'm not 100% sure what happened there, but it seems the main thread delete the shared_ptr<UIState> before the other thread exit. And when the server tries to delete that shared_ptr, it points to nowhere?
I assume manually exit the separate thread before the main should help.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Leggere l’entry point shutdown() e i percorsi di ownership e lifetime di UIState descritti nel report. Determinare in che modo un hook di shutdown potrebbe consentire al server detached di arrestarsi prima che lo stato condiviso venga distrutto, quindi verificare che la chiusura della finestra principale venga completata senza l’errore shared_ptr segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp
- Ambito
- desktop
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100