Merge pull request #1910 from c1728p9/add_virtual_destructors

Add virtual destructor to classes
pull/1872/merge
Sam Grove 2016-06-12 21:37:30 +01:00 committed by GitHub
commit f3c125fca2
4 changed files with 15 additions and 4 deletions

View File

@ -103,6 +103,10 @@ public:
}
#endif
virtual ~AnalogIn() {
// Do nothing
}
protected:
virtual void lock() {

View File

@ -122,6 +122,10 @@ public:
}
#endif
virtual ~AnalogOut() {
// Do nothing
}
protected:
virtual void lock() {

View File

@ -145,6 +145,10 @@ public:
*/
virtual void unlock(void);
virtual ~I2C() {
// Do nothing
}
#if DEVICE_I2C_ASYNCH
/** Start non-blocking I2C transfer.

View File

@ -113,14 +113,13 @@ public:
*/
bool remove_handler(pFunctionPointer_t handler, IRQn_Type irq);
protected:
virtual void lock();
virtual void unlock();
private:
InterruptManager();
~InterruptManager();
void lock();
void unlock();
// We declare the copy contructor and the assignment operator, but we don't
// implement them. This way, if someone tries to copy/assign our instance,
// he will get an error at compile time.