Skip to content

Commit fcc5123

Browse files
author
Joachim Marder
committed
Final fix for issue #24: Ribbon designer freezes during build
1 parent fc5b075 commit fcc5123

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

Designer/Bin/RibbonDesigner.exe

83.5 KB
Binary file not shown.

Designer/Classes/RibbonCompiler.pas

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function TRibbonCompiler.Execute(const Application, CurrentDir: String;
179179
S := GetString(Buffer);
180180
Free;
181181
end;
182-
DoMessage(mkPipe, S);
182+
DoMessage(mkPipe, Trim(S) + sLineBreak);
183183
end;
184184

185185
begin
@@ -199,7 +199,7 @@ function TRibbonCompiler.Execute(const Application, CurrentDir: String;
199199
FillChar(StartupInfo, SizeOf(StartupInfo), 0);
200200
StartupInfo.cb := SizeOf(StartupInfo);
201201
StartupInfo.hStdOutput := WritePipe;
202-
StartupInfo.hStdInput := ReadPipe;
202+
StartupInfo.hStdInput := 0;
203203
StartupInfo.hStdError := WritePipe;
204204
if (ReadPipe = 0) or (WritePipe = 0) then
205205
StartupInfo.dwFlags := 0
@@ -224,17 +224,12 @@ function TRibbonCompiler.Execute(const Application, CurrentDir: String;
224224
repeat
225225
BytesRead := 0;
226226
AppRunning := WaitForSingleObject(ProcessInfo.hProcess, 10);
227-
if (AppRunning <> WAIT_TIMEOUT) then
227+
if PeekNamedPipe(ReadPipe, @Buffer[0], Length(Buffer) -1, @BytesRead, @BytesAvail, @BytesLeft) and (BytesAvail >0) then
228228
begin
229-
PeekNamedPipe(ReadPipe, @Buffer[0], Length(Buffer) -1, @BytesRead, @BytesAvail, @BytesLeft);
230-
LogBuffer;
231-
Break;
232-
end;
233-
234-
if (not ReadFile(ReadPipe, Buffer[0], Length(Buffer) div 20, BytesRead, nil)) then // Read smaller chunks for continuous output
235-
Break;
236-
LogBuffer;
237-
until (BytesRead = 0);
229+
if ReadFile(ReadPipe, Buffer[0], Length(Buffer), BytesRead, nil) then
230+
LogBuffer();
231+
end;//if
232+
until (AppRunning <> WAIT_TIMEOUT);
238233
Result := GetExitCodeProcess(ProcessInfo.hProcess, ExitCode);
239234
Result := Result and (ExitCode = 0);
240235
finally

0 commit comments

Comments
 (0)