Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions bindings/r/src/TRInterface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ TRInterface::TRInterface(const Int_t argc, const Char_t *argv[], const Bool_t lo

TRInterface::~TRInterface()
{
statusEventLoop = kFALSE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should'nt this also contains

if (gR == this) gR = nullptr;

?

if (th) delete th;
}

Expand Down Expand Up @@ -200,17 +201,15 @@ void TRInterface::ProcessEventsLoop()
{
if (!statusEventLoop) {
th = new TThread([](void *args) {
while (kTRUE) {
if (gR) { // in case global object was freed
fd_set *fd;
Int_t usec = 10000;
fd = R_checkActivity(usec, 0);
R_runHandlers(R_InputHandlers, fd);
if (gSystem) gSystem->Sleep(100);
}
while (statusEventLoop) {
fd_set *fd;
Int_t usec = 10000;
fd = R_checkActivity(usec, 0);
R_runHandlers(R_InputHandlers, fd);
if (gSystem) gSystem->Sleep(100);
}
});
th->Run();
statusEventLoop = kTRUE;
th->Run();
}
}