Fixed memory leaks in camera