Let's suppose we have a class whose state has to be saved and later restored, and we resorted to the Memento pattern for that.
What if the state includes resources that have to be explicitly released (like file handles, OpenGL textures, etc)?
Should I make them part of the saved state? This requires handling memento objects in a special manner: if memento was restored, then it's up to the originator class to handle the resources; if memento is dropped, then it has to clean up itself. Pretty entangled logic.
How would you implement Memento when state has resources to be released?