[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Protect against negative size
From:       Joseph Wenninger <jowenn () kde ! org>
Date:       2007-12-10 11:45:56
Message-ID: 200712101245.57047.jowenn () kde ! org
[Download RAW message or body]

On Monday 10 December 2007 12:31:33 Thomas Friedrichsmeier wrote:
> On Sunday 09 December 2007, Vladimir Prus wrote:
> > Now, I don't know what's right solution for this problem.
> > On KDevelop side, I'm gonna make sure KateView is never 0 in height.
> > However, I'd like propose the following patch that merely adds
> > assert -- so that next time somebody runs into this problem, the
> > crash is more obvious.
>
> Ah, thanks for tracking this down. I ran into the same issue with one of
> the kateparts in RKWard, but I had a workaround, and never investigated.
> Testing shows it is indeed this same negative height issue.
>
> Would it be ok to simply add a qMax(1, ...) around the calculation of the
> new cache size, to make sure it is always at least 1?
>

I think, if it doesn't have any bad sideeffects (other crashes, memleaks) this 
is a better idea than the assert, which still terminates the hosting 
application.


> Regards
> Thomas

Kind regards
Joseph Wenninger
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic