Fixed segfaulting when closing tab with selection
Fixed segfaulting when closing tab with selection

iakov/qreal,iakov/qreal,iakov/qreal,iakov/qreal,iakov/qreal,iakov/qreal,iakov/qreal,iakov/qreal,iakov/qreal