Wrap drawing context in try-finally.