mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-19 07:54:59 +01:00
electron-main: Immediatelly set the eventIndex variable to null when closing.
The react-sdk doesn't await the closing of the event index, this is done so because of limitations in the lifecycle module. This wasn't a problem since we used to just set the eventIndex variable to null. Nowadays we wait for Tantivy to shutdown using a close() method on the index. To avoid this being called multiple times while we're already closing the index set the eventIndex variable to null before awaiting. This fixes https://github.com/vector-im/riot-web/issues/12838.
This commit is contained in:
parent
39656bb622
commit
1e05af203c
@ -394,14 +394,16 @@ ipcMain.on('seshat', async function(ev, payload) {
|
|||||||
|
|
||||||
case 'closeEventIndex':
|
case 'closeEventIndex':
|
||||||
if (eventIndex !== null) {
|
if (eventIndex !== null) {
|
||||||
|
let index = eventIndex;
|
||||||
|
eventIndex = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await eventIndex.shutdown();
|
await index.shutdown();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
sendError(payload.id, e);
|
sendError(payload.id, e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
eventIndex = null;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'deleteEventIndex':
|
case 'deleteEventIndex':
|
||||||
|
Loading…
Reference in New Issue
Block a user