[PATCH] Re: SubSurface Crash When changing a gas in diveplanner graph

Guido Lerch guido.lerch at gmail.com
Fri Sep 11 08:06:49 PDT 2015


Hi Robert,

We are calling this with i= -1

	int i = index.row();

	gasmix oldgas = divepoints[i].gasmix;


When testing for -1 and returning if true, you can set the gas mix to all other

divepoints but never to this one, hence I dont beleive that


if ( i < 0 ) return;


would do a proper job.


You want me to investigate further and provide a patch if I can ?


It's my birthday to day, so this would have to wait till Monday :-)


Have all a great weekend.


G.



2015-09-11 16:00 GMT+02:00 Robert Helling <helling at atdotde.de>:

>
> On 11.09.2015, at 12:07, Guido Lerch <guido.lerch at gmail.com> wrote:
>
> <image.png>
> If I click EAN, crash ...
>
> I run this in debug more from QT Creator
> <image.png>
>
>
> To analyze this further in the debugger I would double click on the line
> of level 7 in the stack trace (DivePlannerPointsModel::gas change(…) since
> that is the last line of subsurface code. This brings be into the
> definition of that method and I can inspect the local variables to see that
> we are calling with an index -1.
>
> This is because we are trying to change the gas of a non-existing segement
> as changing the gas via the waypoint context menu means doing a gas change
> there and thus using the new gas on the following legs. Except for the last
> waypoint, there are no following legs as those are only inserted by the
> planner and that handles gases by itself.
>
> So here is a patch that prevents offering a gas change there.
>
> Best
> Robert
>
>
>
>
> --
>
> .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
> Robert C. Helling     Elite Master Course Theoretical and Mathematical
> Physics
>                       Scientific Coordinator
>                       Ludwig Maximilians Universitaet Muenchen, Dept.
> Physik
>                       Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339
>                       http://www.atdotde.de
>
> Enhance your privacy, use cryptography! My PGP keys have fingerprints
> A9D1 A01D 13A5 31FA 6515  BB44 0820 367C 36BC 0C1D    and
> DCED 37B6 251C 7861 270D  5613 95C7 9D32 9A8D 9B8F
>
>
>
>
>
>
>


-- 
Best regards,
Guido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150911/0a6ee04c/attachment-0001.html>


More information about the subsurface mailing list