CtrlCore: Fixed issue with destroying TopWindow

git-svn-id: svn://ultimatepp.org/upp/trunk@11259 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-07-17 10:58:48 +00:00
parent 3d9d163fc4
commit 2d4e9b2dc7
3 changed files with 30 additions and 0 deletions

View file

@ -605,6 +605,33 @@ void LocalProcess::CloseWrite()
#endif
}
/*
int LocalProcess::Finish(String& out)
{
out.Clear();
while(IsRunning()) {
String h = Get();
// if(IsNull(h))
// Sleep(1); // p.Wait would be much better here!
// else
out.Cat(h);
Sleep(1); // p.Wait would be much better here!
}
LLOG("Finish: About to read the rest of output");
for(;;) {
String h = Get();
// DDUMP(h.GetCount());
// DDUMP(h.IsVoid());
if(h.IsVoid())
break;
out.Cat(h);
}
return GetExitCode();
}
*/
int LocalProcess::Finish(String& out)
{
out.Clear();

View file

@ -139,6 +139,8 @@ Size Ctrl::GetMaxSize() const
void Ctrl::SyncLayout(int force)
{
GuiLock __;
if(destroying)
return;
LLOG("SyncLayout " << Name() << " size: " << GetSize());
bool refresh = false;
Rect oview = GetView();

View file

@ -507,6 +507,7 @@ TopWindow::TopWindow()
TopWindow::~TopWindow()
{
GuiLock __;
destroying = true;
if(InLoop())
EndLoop(IDOK);
if(!IsChild())