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

List:       kde-core-devel
Subject:    Re: Kapp and Qt designer issue
From:       Lubos Lunak <l.lunak () suse ! cz>
Date:       2004-03-18 15:22:34
Message-ID: 200403181622.34084.l.lunak () suse ! cz
[Download RAW message or body]

On Thursday 18 of March 2004 15:23, Ian Reinhart Geiser wrote:
> On Thursday 18 March 2004 09:17 am, Lubos Lunak wrote:
> > On Thursday 18 of March 2004 14:56, Ian Reinhart Geiser wrote:
> > > On Thursday 18 March 2004 08:52 am, Waldo Bastian wrote:
> > > > On Thu March 18 2004 14:09, Ian Reinhart Geiser wrote:
> > > > > Greetings,
> > > > > 	It seems that the nullchecks while well intentioned seem useless
> > > > > on my system, as the kapp pointer is initialized and there for NOT
> > > > > 0.
> > > >
> > > > You may want to find out why that happens then.
> > >
> > > This happens because Qt designer dosent use Kapp, it uses QApp and the
> > > kapp ptr is never initialized.
> >
> > kapplication.cpp:136: KApplication* KApplication::KApp = 0L;
>
> Is this going to happen even if it is called from designer?

 That's no real initialization. The pointer is NULL already in the binary (or 
it should be cleared after loading into memory, I'm not sure if it's in .data 
or .bss - but that doesn't matter).

> From what I can see no.

 The attached testcase disagrees. You have a problem somewhere. Maybe 
valgrind's VALGRIND_MAKE_READABLE could help (if it makes things read-only, I 
don't know).

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak@suse.cz , l.lunak@kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/

["a.cpp" (text/x-c++src)]

#include <dlfcn.h>
#include <stdio.h>

int main()
    {
    void* h = dlopen( "/opt/_k/lib/libkdecore.so", RTLD_LAZY );
    if( h == NULL )
        return 1;
    void* ptr = dlsym( h, "_ZN12KApplication4KAppE" );
    if( ptr == NULL )
        return 2;
    printf( "%p %p\n", ptr, *(void**)ptr );
    }


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

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