[PATCH 0/5] Some steps to bring back printing support

Tomaz Canabrava tcanabrava at kde.org
Tue Mar 25 17:02:21 PDT 2014


On Tue, Mar 25, 2014 at 6:47 PM, Lubomir I. Ivanov <neolit123 at gmail.com>wrote:

> On 25 March 2014 23:34, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> > [PATCH 4/5] Print: enable printing with the new profile
> >
> > we again make the already active profile instance re-usable.
> > as mentioned in the patch notes *weird* things happen if we try to create
> > a local instance. the line colors spaz out on the main profile
> > widget and the app crashes soon after.
> >
> > the main widget being affected leans towards singleton issues...
> >
> > the expense factor is not that impacting; even if the profile is
> > a big class, i guess, i theory at least we can create a new instance
> > for printing and let it drift out of scope, once done as you did in
> > ac9a23ef3b69.
> >
> > also, i think there are some scalling issues related to the approach
> > because the print scalling is based on the widget present on the screen
> > and the screen DPI. if the widget is not part of widget stack some odd
> > values are returned and i have no idea what is the cause FTM.
> > the local instance profile's scale is quite off.
> >
>
> here is a screenshot from current master (dd0c995f) that hints about
> the possible singleton or memory corruption issues that i describe in
> the above email.
> http://imgur.com/T9DmnEz
>
> similar to the #478 report.
>


This is most likely because when you create a new instance of the
ProfileWidget and send a dive to it to be plotted , the C code that does
the calculations for the dive info is deleting the old one ( the one that`s
attached to the mainWindow)  - but we still keep the reference of it.
One way to make that work is to not have globals to hold stuff, instead
pass the plot_info as parameter. This is something that I need to do if I
want to support showing more than one dive at the same time on the new
profile, so it`s definitely on my TODO list.



>
> haven't looked much into that, but i see no reason how the main
> Profile2 instance should be affected by creating a function-local
> instance of a new Profile2.
> also oddly, this is produced *after* the print dialog is closed and
> the crash is not always reproduced (couldn't catch it).
>
> lubomir
> --
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140325/f1d6e849/attachment.html>


More information about the subsurface mailing list