Solid upower backend and kdeinit crash...

Matthias Fuchs mat69 at gmx.net
Fri Oct 29 23:47:48 BST 2010


Am Freitag 29 Oktober 2010, 22:28:01 schrieb Dawit A:
> On Fri, Oct 29, 2010 at 3:48 PM, Chani <chanika at 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)
?




More information about the kde-core-devel mailing list