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

List:       kde-core-devel
Subject:    Re: Solid upower backend and kdeinit crash...
From:       Matthias Fuchs <mat69 () gmx ! net>
Date:       2010-10-29 22:47:48
Message-ID: 201010300047.49218.mat69 () gmx ! net
[Download RAW message or body]

Am Freitag 29 Oktober 2010, 22:28:01 schrieb Dawit A:
> On Fri, Oct 29, 2010 at 3:48 PM, Chani <chanika@gmail.com> wrote:
> >> > I'd probably have to read the code to know whether it was sane (and I
> >> > can't tell what constructor you're referring to)
> >> 
> >> kdebase/workspace/powerdevil/daemon/backends/upower/xrandrbrightness.cpp
> > 
> > oh jeez, it doesn't init m_backlight if it doesn't get far enough... it
> > should init that to *something*. especially since other functions are
> > using it. meep.
> 
> yep...
> 
> > hmm, and m_isSuppported is logically equivalent to (m_resources != null)
> > so it's redundant - but harmless.
> 
> yep... there is no need for that flag at all. It is redundant.
> 
> > I say, make sure m_backlight has a default value up there where
> > m_resources is set null, and then add an isSupported check at the top of
> > *every* function in there (well, besides itself of course ;)
> 
> Or set the m_backlight as you stated, get rid of the unnecessary
> m_isSupported flag altogether
> and simply check m_resources before using it, as in the attached patch...
> :)

Wouldn't it be better to have 
if (cur != -1.0)
?
[prev in list] [next in list] [prev in thread] [next in thread] 

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