Fixed some memory leaks in the Plot Gallery example app.