Closed ProggyCoder closed 3 years ago
I'm inclined to accept this PR even though the behavior you describe sounds like an extreme corner case. Besides, for consistency reasons the same pattern might possibly have to be applied to other protected functions implemented by derived classes.
Proposal: store (and use) output of getBufferOffset() in separate member variable
Reason: getBufferOffset() will be implemented in derived class; by removing (deconstructing) the derived class, the implemented version of getBufferOffset() will be no more available in the deconstructor ~OLEDDisplay()
Background: implementing a temporary instance of derviced class will lead to abort/reboot; behaviour is not recoginizable if the derived class is implemented globally (as is commenly done)