The difference is in the second case, you are probably using a
default constructor (depends on the compiler, but many compilers
change 'Type variable = value' to 'Type variable(value)', and
in the first case, you are using a genuine copy constructor.
For some reason (this=0x0), you are copying from a null pointer.
Somehow, looks like the TokenHelpDialog::S_TOKEN_SEPARATOR is
not initalized yet when you are running that code.

John

On 12/30/2011 2:16 PM, Dan Armbrust wrote:
> So, I'm not a C++ developer.  At all.
>
> But I got annoyed that the latest ubuntu "upgrade" broke KRename.
>
> It just segfaults.
>
> So, I'm stumbling around.
>
> Got a backtrace:
>
> Program received signal SIGSEGV, Segmentation fault.
> QBasicAtomicInt::ref (this=0x0) at /usr/include/qt4/QtCore/qatomic_x86_64.h:121
> 121                      : "memory");
> (gdb) backtrace
> #0  QBasicAtomicInt::ref (this=0x0) at
> /usr/include/qt4/QtCore/qatomic_x86_64.h:121
> #1  0x0000000000463c43 in __static_initialization_and_destruction_0
> (__priority=65535, __initialize_p=1)
>      at /home/Desktop/krename-4.0.7/src/plugin.cpp:22
> #2  0x000000000048087d in __libc_csu_init ()
> #3  0x00007ffff488c2a0 in __libc_start_main (main=0x41bcd0<main(int,
> char**)>, argc=1, ubp_av=0x7fffffffe108,
>      init=0x480820<__libc_csu_init>, fini=<optimized out>,
> rtld_fini=<optimized out>, stack_end=0x7fffffffe0f8)
>      at libc-start.c:185
> #4  0x000000000041e491 in _start ()
>
>
> The line of code at plugin.cpp:22 is:
>
> const QString Plugin::S_TOKEN_SEPARATOR = TokenHelpDialog::S_TOKEN_SEPARATOR;
>
> TokenHelpDialog::S_TOKEN_SEPARATOR is defined as:
>
> const QString TokenHelpDialog::S_TOKEN_SEPARATOR = ";;";
>
> in tokenHelpDialog.cpp
>
> If I modify the line where the segfault occurs to :
>
> const QString Plugin::S_TOKEN_SEPARATOR = ";;";
>
> And compile it, it runs with out a segfault.
>
> What obvious thing am I missing about how C++ works?
>
> Thanks,
>
> Dan
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list