Avoid memory leaks when resetting preview window
Fix crash on camera release