Close graphics dev in finally clause\ncloses #4408 (already closed)
Merge pull request #5839 from davclark/rmagic-graphics

Close graphics dev in finally clause