Skip to content

Commit f965330

Browse files
committed
- Inheritence Fix for IThread
1 parent 96b4912 commit f965330

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/ESPressio_IThread.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ namespace ESPressio {
2929
*/
3030
class IThread {
3131
public:
32-
// Destructor
33-
34-
/// The Destructor is declared as `virtual` to ensure that the correct destructor is called when a derived class is destroyed.
35-
virtual ~IThread() {
36-
DoNotifyDestroy();
37-
}
3832
// Methods
3933

4034
/// `Initialize` is invoked automatically for all Threads when the `ThreadManager` is initialized in your `main()` (or `setup()` for MCU projects) function.

src/ESPressio_Thread.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace ESPressio {
2020
`Thread` is a class that represents a "standard" Thread in the system.
2121
It is a wrapper around the system's Thread API, designed to make them much easier to use.
2222
*/
23-
class Thread : public IThread {
23+
class Thread : public IThread, public Object<Thread> {
2424
private:
2525
// Type Definitions
2626

@@ -120,7 +120,10 @@ namespace ESPressio {
120120
SetFreeOnTerminate(freeOnTerminate);
121121
}
122122

123-
~Thread();
123+
virtual ~Thread() override {
124+
Terminate();
125+
GarbageCollect();
126+
};
124127

125128
// Methods
126129
void GarbageCollect();

0 commit comments

Comments
 (0)