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 4705b6b3a5
commit 041530ee72
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) void Results::set_live(bool live)
{ {
validate_read();
if (!live && m_mode == Mode::Table) { if (!live && m_mode == Mode::Table) {
m_query = m_table->where(); m_query = m_table->where();
m_mode = Mode::Query; m_mode = Mode::Query;