[PATCH] gui: do not run search while trace still loading

José Fonseca jose.r.fonseca at gmail.com
Thu Feb 12 12:44:36 PST 2015


Thanks. I've also removed the Q_ASSERTs (as they aren't right per your
code) and pushed.

Jose

On Thu, Feb 12, 2015 at 9:25 AM, Tapani Pälli <tapani.palli at intel.com>
wrote:

> Patch fixes a crash if impatient user (like me) makes a search
> before trace has been loaded.
>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  gui/mainwindow.cpp | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
> index a503b5d..ff89ad7 100644
> --- a/gui/mainwindow.cpp
> +++ b/gui/mainwindow.cpp
> @@ -1118,6 +1118,10 @@ void MainWindow::slotSearchNext(const QString &str,
>
>      Q_ASSERT(call || frame);
>      if (!frame) {
> +        // Trace is still loading.
> +        if (!call) {
> +            return;
> +        }
>          frame = call->parentFrame();
>      }
>      Q_ASSERT(frame);
> @@ -1133,6 +1137,10 @@ void MainWindow::slotSearchPrev(const QString &str,
>
>      Q_ASSERT(call || frame);
>      if (!frame) {
> +        // Trace is still loading.
> +        if (!call) {
> +            return;
> +        }
>          frame = call->parentFrame();
>      }
>      Q_ASSERT(frame);
> --
> 2.1.0
>
> _______________________________________________
> apitrace mailing list
> apitrace at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/apitrace
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/apitrace/attachments/20150212/9d968aa9/attachment.html>


More information about the apitrace mailing list