Skip to content

Commit 7637d36

Browse files
committed
Bug fix: 1) makefile dependencies, test tools could be built without
library being ready. 2) destructor did not wait for thread to fully exit.
1 parent d2a99ba commit 7637d36

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ $(LIBFILE):$(LIBOBJS)
7070
ln -sf $(LIBFILE) $(LIBNAME).so
7171

7272

73-
src/test/TestXPlaneBeaconListener: $(TESTOBJS)
73+
src/test/TestXPlaneBeaconListener: $(TESTOBJS) $(LIBFILE)
7474
$(CC) -L . -o $@ src/test/TestXPlaneBeaconListener.o $(LIBNAME).so
7575

7676

77-
src/test/TestXPlaneUDPClient: $(TESTOBJS)
77+
src/test/TestXPlaneUDPClient: $(TESTOBJS) $(LIBFILE)
7878
$(CC) -L . -o $@ src/test/TestXPlaneUDPClient.o $(LIBNAME).so
7979

8080
clean:

src/libsrc/XPlaneUDPClient.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,11 @@ XPlaneUDPClient::~XPlaneUDPClient() {
151151

152152
time_t nowTime = time(NULL);
153153

154-
while (isRunning && nowTime < time(NULL) - 5) {
154+
while (isRunning && time(NULL) < nowTime + 5) {
155155
if (debug) {
156156
cerr << "waiting for XPlaneUDPClient to stop" << endl;
157157
}
158+
usleep (100000); // 10ms
158159
}
159160

160161
if (isRunning) {

0 commit comments

Comments
 (0)