Fix crash when closing tab during a search
This commit is contained in:
parent
fe910fce49
commit
b130162d56
@ -183,6 +183,13 @@ class WebEngineSearch(browsertab.AbstractSearch):
|
|||||||
self._pending_searches))
|
self._pending_searches))
|
||||||
return
|
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"
|
found_text = 'found' if found else "didn't find"
|
||||||
if flags:
|
if flags:
|
||||||
flag_text = 'with flags {}'.format(debug.qflags_key(
|
flag_text = 'with flags {}'.format(debug.qflags_key(
|
||||||
|
@ -283,3 +283,9 @@ Feature: Searching on a page
|
|||||||
Then the following tabs should be open:
|
Then the following tabs should be open:
|
||||||
- data/iframe_search.html
|
- data/iframe_search.html
|
||||||
- data/hello.txt (active)
|
- 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
|
||||||
|
Loading…
Reference in New Issue
Block a user