mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-13 19:29:58 +01:00
Non-blocking deletion of source in SourcePreview
Detach a thread to delete the source currently in SourcePreview in Source new panel; avoids freezing display.
This commit is contained in:
@@ -7877,11 +7877,15 @@ SourcePreview::SourcePreview() : source_(nullptr), label_(""), reset_(0)
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
static void deletesource(Source *s)
|
||||||
|
{
|
||||||
|
delete s;
|
||||||
|
}
|
||||||
|
|
||||||
void SourcePreview::setSource(Source *s, const string &label)
|
void SourcePreview::setSource(Source *s, const string &label)
|
||||||
{
|
{
|
||||||
if(source_)
|
if(source_)
|
||||||
delete source_;
|
std::thread (deletesource, source_).detach();
|
||||||
|
|
||||||
source_ = s;
|
source_ = s;
|
||||||
label_ = label;
|
label_ = label;
|
||||||
|
|||||||
Reference in New Issue
Block a user