Mercurial > hg > octave-nkf
comparison libgui/src/main-window.cc @ 18312:9a43d8d6e29e stable
avoid startup crash if curl library is not available (bug #41067)
* main-window.cc (news_reader::process): Don't attempt to use
url_transfer object unless it is valid.
* urlwrite.cc (ch_manager::do_make_curl_handle, Furlwrite, Furlread):
Likewise.
* url-transfer.cc (url_transfer::url_transfer): Don't call
disabled_error.
(disabled_error): Delete unused function.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 15 Jan 2014 15:22:03 -0500 |
parents | 09ef57c61b3b |
children | 78c3b4cb0c7f 4e49bc41f899 |
comparison
equal
deleted
inserted
replaced
18311:de72c443ed3f | 18312:9a43d8d6e29e |
---|---|
365 | 365 |
366 QString url = base_url + "/" + page; | 366 QString url = base_url + "/" + page; |
367 std::ostringstream buf; | 367 std::ostringstream buf; |
368 url_transfer octave_dot_org (url.toStdString (), buf); | 368 url_transfer octave_dot_org (url.toStdString (), buf); |
369 | 369 |
370 Array<std::string> param; | 370 if (octave_dot_org.is_valid ()) |
371 octave_dot_org.http_get (param); | 371 { |
372 | 372 Array<std::string> param; |
373 if (octave_dot_org.good ()) | 373 octave_dot_org.http_get (param); |
374 html_text = QString::fromStdString (buf.str ()); | 374 |
375 if (octave_dot_org.good ()) | |
376 html_text = QString::fromStdString (buf.str ()); | |
377 } | |
375 | 378 |
376 if (html_text.contains ("this-is-the-gnu-octave-community-news-page")) | 379 if (html_text.contains ("this-is-the-gnu-octave-community-news-page")) |
377 { | 380 { |
378 if (serial >= 0) | 381 if (serial >= 0) |
379 { | 382 { |