Add validate_read() check to Results::set_live()

If the Results is detached, then this can cause a crash.
This commit is contained in:
Scott Kyle 2016-04-28 09:39:53 -07:00
parent cf5112467c
commit 850e3a4090
1 changed files with 2 additions and 0 deletions

View File

@ -82,6 +82,8 @@ void Results::validate_write() const
void Results::set_live(bool live)
{
validate_read();
if (!live && m_mode == Mode::Table) {
m_query = m_table->where();
m_mode = Mode::Query;