[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sup-talk] Crash while in thread-view-mode
Excerpts from William Morgan's message of Thu Oct 15 14:46:51 +0200 2009:
> Reformatted excerpts from Ben Gamari's message of 2009-10-07:
> > There must be a better way to deal with these invalid ids than
> > crashing. Is there any reason this needs to be a show-stopping event?
>
> This is probably a symptom of some thread protection issues. You're
> right, there's no reason this needs to crash Sup. You could apply this:
>
> diff --git a/lib/sup/modes/thread-index-mode.rb
> b/lib/sup/modes/thread-index-mode.rb
> index 82f258b..17d5836 100644
> --- a/lib/sup/modes/thread-index-mode.rb
> +++ b/lib/sup/modes/thread-index-mode.rb
> @@ -222,7 +222,7 @@ EOS
> def update
> @mutex.synchronize do
> ## let's see you do THIS in python
> - @threads = @ts.threads.select { |t| !@hidden_threads[t] }.sort_by { |t|
> [t.date, t.first.id] }.reverse
> + @threads = @ts.threads.select { |t| !@hidden_threads[t] }.select { |t|
> t.first }.sort_by { |t| [t.date, t.first.id] }.reverse
> @size_widgets = @threads.map { |t| size_widget_for_thread t }
> @size_widget_width = @size_widgets.max_of { |w| w.display_length }
> end
Man, I love you, I can finally use sup again.
(and I love the Python comment, even if I have no effing idea of what
the code could mean.)
Thanks!
--
Guillaume
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk