Fix MAGN-4095 Getting crash while running Document after closing and reopening again.
Merge pull request #2112 from Randy-Ma/magn-4095

Fix MAGN-4095 Getting crash while running Document after closing and reopening again.