"Fix" the crash at startup on MSVC
authorOlivier Goffart <olivier.goffart@nokia.com>
Fri, 15 Jul 2011 15:51:07 +0000 (17:51 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 15 Jul 2011 16:46:50 +0000 (18:46 +0200)
commit6c984d6c15a0b0a210aac12513217fc08437c690
tree1956df0a8afadd40cd06600a2fd81a473d44f9f1
parentb1a0f7c0d23fb303b00265bb2c5615990f909f98
"Fix" the crash at startup on MSVC

The problem is that for some reasons, QByteArray::shared_null (and
probably shared_empty, and the ones for QString) are not in the .rodata
anymore, and they are initialized by code.
programs like QMake, which has others global objects (like global
QFiles) that uses QByteArray crashes, because they reference and
dereference shared_null (and try to destroy shared_null)
That happens before shared_null's refcount is initialized to -1

The solution here is not to ref() the objects that have a refcount of 0
(that is what the refcount is before it is initialized to -1)

The real fix to this problem would be to understand why it is not in the
proper section, and make sure it is.

Change-Id: I5b7e966ed4c460b90dba70855f4dc50685dff97f
Reviewed-on: http://codereview.qt.nokia.com/1712
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/corelib/tools/qrefcount.h