Fix crash when closing tab during a search

This commit is contained in:
Florian Bruhin 2018-10-07 15:46:40 +02:00
parent fe910fce49
commit b130162d56
2 changed files with 13 additions and 0 deletions

View File

@ -183,6 +183,13 @@ class WebEngineSearch(browsertab.AbstractSearch):
self._pending_searches))
return
if sip.isdeleted(self._widget):
# This happens when starting a search, and closing the tab
# before results arrive.
log.webview.debug("Ignoring finished search for deleted "
"widget")
return
found_text = 'found' if found else "didn't find"
if flags:
flag_text = 'with flags {}'.format(debug.qflags_key(

View File

@ -283,3 +283,9 @@ Feature: Searching on a page
Then the following tabs should be open:
- data/iframe_search.html
- data/hello.txt (active)
Scenario: Closing a tab during a search
When I run :open -b about:blank
And I run :search a
And I run :tab-close
Then no crash should happen