Skip to content

Commit ba1121c

Browse files
committed
fix a couple of issues with last change
1 parent 344fc8a commit ba1121c

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

src/grep_proc.cc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,20 @@ grep_proc<LineType>::start()
115115

116116
require(this->invariant());
117117

118-
if (this->gp_sink) {
119-
// XXX hack to make sure threads used by line_buffer are not active
120-
// before the fork.
121-
this->gp_sink->grep_quiesce();
122-
}
123-
124118
log_info("grep_proc(%p): start with highest %d",
125119
this,
126120
(int) this->gp_highest_line);
127121
if (this->children_active() || this->gp_queue.empty()) {
128122
log_debug("grep_proc(%p): nothing to do?", this);
129123
return;
130124
}
125+
126+
if (this->gp_sink) {
127+
// XXX hack to make sure threads used by line_buffer are not active
128+
// before the fork.
129+
this->gp_sink->grep_quiesce();
130+
}
131+
131132
for (const auto& [index, elem] : lnav::itertools::enumerate(this->gp_queue))
132133
{
133134
log_info(" queue[%lu]: [%d:%d)",

src/textview_curses.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,10 +1005,12 @@ textview_curses::execute_search(const std::string& regex_orig)
10051005
top -= REVERSE_SEARCH_OFFSET;
10061006
}
10071007
this->tc_search_op_id = std::move(op_guard).suspend();
1008-
gp->queue_request(
1009-
top, gp->until_eof(this->tc_sub_source->text_line_count()));
1010-
if (top > 0) {
1011-
gp->queue_request(0_vl, gp->until_line(top));
1008+
if (this->tc_sub_source != nullptr) {
1009+
gp->queue_request(
1010+
top, gp->until_eof(this->tc_sub_source->text_line_count()));
1011+
if (top > 0) {
1012+
gp->queue_request(0_vl, gp->until_line(top));
1013+
}
10121014
}
10131015
this->tc_search_start_time = std::chrono::steady_clock::now();
10141016
this->tc_search_duration = std::nullopt;

0 commit comments

Comments
 (0)