viz: fixed memory leak (master)

Viz module: fixed memory leak (master branch)
http://code.opencv.org/issues/3961