mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-08 20:45:13 +00:00
Fixes race condition between vWatch and _CONSOLETITLE
It was a love triangle with _WindowHandle in the end, it's complicated.
This commit is contained in:
parent
f9c35a57d3
commit
744bd19107
|
@ -26203,15 +26203,15 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
||||||
int32 func__screenhide(){return -screen_hide;}
|
int32 func__screenhide(){return -screen_hide;}
|
||||||
|
|
||||||
void sub__consoletitle(qbs* s){
|
void sub__consoletitle(qbs* s){
|
||||||
if (new_error) return;
|
|
||||||
static qbs *sz=NULL; if (!sz) sz=qbs_new(0,0);
|
|
||||||
static qbs *cz=NULL; if (!cz){cz=qbs_new(1,0); cz->chr[0]=0;}
|
|
||||||
qbs_set(sz,qbs_add(s,cz));
|
|
||||||
if (console){ if (console_active){
|
|
||||||
#ifdef QB64_WINDOWS
|
#ifdef QB64_WINDOWS
|
||||||
SetConsoleTitle((char*)sz->chr);
|
char *title;
|
||||||
#endif
|
title = (char *)malloc(s->len + 1);
|
||||||
|
title[s->len] = '\0'; //add NULL terminator
|
||||||
|
memcpy(title, s->chr, s->len);
|
||||||
|
if (console){ if (console_active){
|
||||||
|
SetConsoleTitle(title);
|
||||||
}}
|
}}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -97,11 +97,13 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
|
||||||
LOOP
|
LOOP
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF vw_hwndsent = 0 AND _WINDOWHANDLE > 0 THEN
|
IF vw_hwndsent = 0 THEN
|
||||||
|
IF _WINDOWHANDLE > 0 THEN
|
||||||
vw_hwndsent = -1
|
vw_hwndsent = -1
|
||||||
vw_cmd$ = "hwnd:" + _MK$(_OFFSET, _WINDOWHANDLE)
|
vw_cmd$ = "hwnd:" + _MK$(_OFFSET, _WINDOWHANDLE)
|
||||||
GOSUB SendCommand
|
GOSUB SendCommand
|
||||||
END IF
|
END IF
|
||||||
|
END IF
|
||||||
|
|
||||||
IF vwatch_linenumber = 0 THEN
|
IF vwatch_linenumber = 0 THEN
|
||||||
GOSUB SendCallStack
|
GOSUB SendCallStack
|
||||||
|
|
Loading…
Reference in a new issue