Wow, that's no doubt a school case for programming classes... The crash doesn't occur under Linux, because gcc inlines the faulty code while VS2010 apparently doesn't... For the programmers among you, here is the fault (in indra/llcommon/llrefcount.h):
In the former releases, the code was:
Which I optimized in:
Problem is: mRef gets dereferenced when "delete this;" is executed, so "return mRef;" causes a crash since it points to a freed memory emplacement. The crash doesn't happen with gcc-compiled viewers because gcc inlines the whole class (and mRef is always valid). While "inline" is used, it is only an informative directive that the compiler can ignore, and VS2010 ignored it...
I replaced this faulty code with this one, for the next releases:
LL_FORCE_INLINE is a custom macro that expands into a compiler-specific directive, forcing the said compiler to inline the code. Note that I kept "return 0", because depending how the memory for mRef is reserved by the compiler, it could be freed or not by "delete this;", even in an otherwise fully inlined class...
Anyway, I will publish new releases ASAP, because while this bug doesn't affect at all Linux builds, it does hit hard Windows ones, and can cause crashes all over the viewer code, in many different situations, and not only on logout.