Mercurial > vim
comparison src/ui.c @ 17708:10696f279e20 v8.1.1851
patch 8.1.1851: crash when sound_playfile() callback plays sound
commit https://github.com/vim/vim/commit/28e67e0c1496b7bb166a0acfb176690f219101ca
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 15 23:05:49 2019 +0200
patch 8.1.1851: crash when sound_playfile() callback plays sound
Problem: Crash when sound_playfile() callback plays sound.
Solution: Invoke callback later from event loop.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 15 Aug 2019 23:15:04 +0200 |
parents | d5e5d0fc3fa8 |
children | f800c3d8ca1b |
comparison
equal
deleted
inserted
replaced
17707:bf211be8ffd1 | 17708:10696f279e20 |
---|---|
457 /* timer may have used feedkeys() */ | 457 /* timer may have used feedkeys() */ |
458 return FAIL; | 458 return FAIL; |
459 } | 459 } |
460 if (due_time <= 0 || (wtime > 0 && due_time > remaining)) | 460 if (due_time <= 0 || (wtime > 0 && due_time > remaining)) |
461 due_time = remaining; | 461 due_time = remaining; |
462 # ifdef FEAT_JOB_CHANNEL | 462 # if defined(FEAT_JOB_CHANNEL) || defined(FEAT_SOUND_CANBERRA) |
463 if ((due_time < 0 || due_time > 10L) | 463 if ((due_time < 0 || due_time > 10L) && ( |
464 # ifdef FEAT_GUI | 464 # if defined(FEAT_JOB_CHANNEL) |
465 && !gui.in_use | 465 ( |
466 # if defined(FEAT_GUI) | |
467 !gui.in_use && | |
468 # endif | |
469 (has_pending_job() || channel_any_readahead())) | |
470 # ifdef FEAT_SOUND_CANBERRA | |
471 || | |
472 # endif | |
466 # endif | 473 # endif |
467 && (has_pending_job() || channel_any_readahead())) | 474 # ifdef FEAT_SOUND_CANBERRA |
475 has_any_sound_callback() | |
476 # endif | |
477 )) | |
468 { | 478 { |
469 // There is a pending job or channel, should return soon in order | 479 // There is a pending job or channel, should return soon in order |
470 // to handle them ASAP. Do check for input briefly. | 480 // to handle them ASAP. Do check for input briefly. |
471 due_time = 10L; | 481 due_time = 10L; |
472 brief_wait = TRUE; | 482 brief_wait = TRUE; |