From: Manfred Steiner <sx@htl-kaindorf.at>
Date: Sat, 30 Sep 2023 15:22:25 +0000 (+0200)
Subject: minor fixes
X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=405b66cebf64e989e30afbd345e26b8d98a22116;p=sx%2Fsimavr.git

minor fixes
---

diff --git a/README.md b/README.md
index 5566deb..265da2f 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ This repository is mirrored from [https://github.com/buserror/simavr.git](https:
 ```sh
 $ sudo apt install gcc make gcc-avr avr-libc git
 $ sudo apt install libelf-dev
-$ sudo apt install freeglut3 freeglut3-dev
+$ sudo apt install freeglut3-dev
 $ sudo apt install libncurses5 libncurses5-dev
 ```
 
diff --git a/examples/simuc/Makefile b/examples/simuc/Makefile
index e3ee48d..c8d1971 100644
--- a/examples/simuc/Makefile
+++ b/examples/simuc/Makefile
@@ -73,6 +73,7 @@ deb: dpkg $(DEBSRC)/DEBIAN/control $(DEBSRC)/usr/share/doc/htl-simuc/readme
 .PHONY: $(DEBSRC)/DEBIAN/control $(DEBSRC)/usr/share/doc/htl-simuc/readme
 
 $(DEBSRC)/DEBIAN/control:
+	@test -d $(DEBSRC)/DEBIAN || mkdir $(DEBSRC)/DEBIAN
 	@test -n "${LIBC_NAME}" && test -n "${LIBC_VERSION}"
 	@test -n "${LIBCXX_NAME}" && test -n "${LIBCXX_VERSION}"
 	@test -n "${LIBELF_NAME}" && test -n "${LIBELF_VERSION}"
diff --git a/examples/simuc/src/simavr/simavr.cpp b/examples/simuc/src/simavr/simavr.cpp
index c3fc119..f054e7c 100644
--- a/examples/simuc/src/simavr/simavr.cpp
+++ b/examples/simuc/src/simavr/simavr.cpp
@@ -433,9 +433,9 @@ struct SimAvrEvent SimAvr::waitForEvent () {
 			rv = *p;
 			if (p->event != EventShutdown) {
 				events.pop_front();
-				free(p);
+				free(p); p = NULL;
 			}
-			if (p->event == EventShutdown) {
+			if (p != NULL && p->event == EventShutdown) {
 				cancelThread = true;
 				isShutdown = true;
 			}