summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qsharedpointer_impl.h
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year in Digia's license headersSergio Ahumada2013-01-131-1/+1
| | | | | | Change-Id: I52bf8ef0447b701b4ebf7d7d240013a72adb9425 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Don't increase the reference count if dynamic_cast failedThiago Macieira2013-01-051-0/+2
| | | | | | | | | | | | | | If the dynamic_cast failed in QSharedPointer::dynamicCast or qSharedPointerDynamicCast, we should avoid creating the QSharedPointer that shares the weak and strong reference counts. In Qt 5, this does not imply a leak since the original pointer is stored internally for deletion. In Qt 4 it implies a leak under certain circumstances, which this change fixes. Task-number: QTBUG-28924 Change-Id: Id2de140de4cf676461e14b201ad250c53666b79d (cherry-picked from qt5 commit a094bf5a893c3cccffff10c1420bfbe3a3c02a7c) Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-291-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I280c0a575987d1770e354b4948f1d4d767d711ea Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QSharedPointer: make QT_SHAREDPOINTER_TRACK_POINTERS work with QObjectsGiuseppe D'Angelo2012-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | If setQObjectShared crashes because a QObject is tracked by two different QSharedPointers, we lose the debug feature offered by #defining QT_SHAREDPOINTER_TRACK_POINTERS, as the check done by this define happens after the setQObjectShared call. Therefore, move setQObjectShared after the internalSafetyCheckAdd2 call. This way, the error raised by QSharedPointer created changes from f.i. QSharedPointer: pointer 0xa10010 already has reference counting to the more "debuggable" (and consistent with non-QObjects) QSharedPointer: internal self-check failed: pointer 0x1dd90e0 was already tracked by another QSharedPointer object 0x1dd9330 "Backport" of change-id I71340d0f878828354537762d01c46d441efc918c from qtbase (although, as of commit 609b0a9c2e69180ceff5d89c42e0d9468491d7e3, this issue is not present there, as setQObjectShared does nothing). Change-Id: I4cea83d705795eae0e05da128a3f189aea36f5ce Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update contact information in license headers.Sergio Ahumada2012-08-011-2/+2
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fix access to uninitialized pointerTobias Hunger2012-07-031-1/+1
| | | | | | | | | | | | The C++ standard says in 9.4..2 that the object expression is evaluated, so any compliant compiler may access d. So this syntax is a bug in this place. This is a backport of commit 88cf9402e336fddeb673c92f3c14da47a9f8450b from qtbase. Change-Id: I02a9a1b73f7c18e8342aafeae412759f78086fa6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-111-1/+1
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-131-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-02-011-0/+10
|\ | | | | | | | | | | Conflicts: mkspecs/features/symbian/application_icon.prf src/sql/drivers/odbc/qsql_odbc.cpp
| * Make syncqt not complain about missing header macros.Thiago Macieira2011-01-271-0/+10
| | | | | | | | | | | | | | | | | | qsharedpointer_impl.h contains class definitions that are also mirrored in qsharedpointer.h (which is there for qdoc3), so we have a macro to stop processing. Task-number: QTBUG-16912 Reviewed-by: Olivier Goffart
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Fix compilation in namespaceOlivier Goffart2010-10-291-1/+1
| | | | | | | | Reviewed-by: Joao
* | qSwap: use std::swap as implementation, and specialize std::swap for our ↵Olivier Goffart2010-10-291-0/+10
| | | | | | | | | | | | | | | | | | | | | | container std::swap might be reimplemented for many types. That might speedup our Qt algorithms that uses qSwap. (std::swap also use std::move) Specialize std::swap for our shared type, so stl algorithls work faster Reviewed-by: Joao
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-10-251-3/+11
|\ \ | |/ | | | | | | | | | | | | | | | | Conflicts: demos/declarative/snake/snake.qml qmake/generators/symbian/symbiancommon.cpp src/network/access/qnetworkaccessmanager.cpp src/s60installs/s60installs.pro tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp tests/auto/qnetworkreply/tst_qnetworkreply.cpp
| * Fix warning introduced by last commit on hiding of the 'd' memberThiago Macieira2010-10-231-2/+2
| | | | | | | | | | qsharedpointer_impl.h: In constructor 'QtSharedPointer::ExternalRefCount<T>::ExternalRefCount(T*, Deleter)': qsharedpointer_impl.h:385: warning: declaration of 'd' shadows a member of 'this'
| * Fix access to uninitialised memory in case of new throwingThiago Macieira2010-10-221-3/+11
| | | | | | | | | | | | | | Testing will come later with a full test for exception issues Task-number: QTBUG-14637 Reviewed-by: Olivier Goffart
* | C++0x move operatorsOlivier Goffart2010-09-031-0/+7
| | | | | | | | | | | | | | This makes assignement faster from temporaries, as the operator is fully inline, and doesn't do any atomic operations. Reviewed-by: joao
* | Fix build os QSharedPointer on MSVCOlivier Goffart2010-08-111-1/+1
| | | | | | | | | | | | Which does not support template friends Reviewed-by: Thiago
* | Optimize QSharedPointer::operator=(const QSharedPointer &)Olivier Goffart2010-08-101-1/+7
| | | | | | | | | | | | | | | | internalSet check that stringref is > 0 Which is not required as we do not assign from a QWeakPointer Reviewed-by: Thiago Task-number: QTBUG-12700
* | Remove obsolete code & workarounds for unsupported versions of MS Visual C++miniak2010-08-031-1/+0
| | | | | | | | | | | | | | The minimum supported version of MS Visual C++ 2003, which is _MSC_VER 1310. Merge-request: 756 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-07-281-14/+17
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qapplication.cpp tests/auto/qfileinfo/tst_qfileinfo.cpp tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt.qdocconf
| * Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Thiago Macieira2010-07-151-14/+17
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/syncqt src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.h src/3rdparty/webkit/WebCore/page/FrameView.cpp src/3rdparty/webkit/WebCore/page/FrameView.h src/3rdparty/webkit/WebCore/platform/ScrollView.cpp src/3rdparty/webkit/WebCore/platform/ScrollView.h src/corelib/plugin/quuid.cpp src/gui/dialogs/qfontdialog.cpp src/multimedia/audio/qaudiodevicefactory.cpp src/opengl/qgl.cpp src/openvg/qpaintengine_vg.cpp tests/auto/qxmlquery/tst_qxmlquery.cpp
| | * Fix a crash when recursing into QSharedPointer from QSharedPointer::clear()Thiago Macieira2010-07-091-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to delete the tracked object before the new tracking was properly set up in QSharedPointer. That means if the tracked object's destructor or deletion function recursed into the QSharedPointer, it would find itself in an inconsistent state. So instead finish the setup and only then call out to user code. That ensures the internal state is always valid. Task-number: QTBUG-11730 Reviewed-by: ossi
* | | Fix warning with gcc in -pedanticOlivier Goffart2010-06-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Empty marcro arguments throws warning on some compilers. (Correction of 89dfa8d7a46c992b066e5335d64089bf796e2f83) Reviewed-by: Thiago Task-number: QTBUG-11334
* | | Make QWeakPointer and QSharedPointer movableOlivier Goffart2010-05-281-1/+5
|/ / | | | | | | | | | | For making QVector of them faster. Reviewed-by: Thiago
* | Fix building with Sun CC 5.10: missing :: for the QWeakPointer declarationThiago Macieira2010-03-011-2/+2
| |
* | Add an extra operator delete() to QSharedPointer's internals.Thiago Macieira2010-02-241-0/+1
| | | | | | | | | | | | | | Maybe this fixes a warning that MSVC produces. But no guarantees. Task-number: QTBUG-8462 Reviewed-by: Trust Me
* | Merge remote branch 'origin/4.6' into integration-master-from-4.6Rohan McGovern2010-02-181-2/+2
|\ \ | |/ | | | | | | Conflicts: src/corelib/codecs/qtextcodec.h
| * Change all ptrdiff_t to qptrdiff.Thiago Macieira2010-02-171-2/+2
| | | | | | | | Reviewed-By: Bradley T. Hughes
* | Add operator< and qHash for QSharedPointer and fix operator-.Thiago Macieira2010-02-151-2/+47
|/ | | | | | This allows using QSharedPointer in QHash and QMap keys. Reviewed-by: Bradley T. Hughes
* Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | Reviewed-by: Trust Me
* Fixed qsharedpointer auto test build break for Symbian OS.Janne Anttila2009-09-281-1/+1
| | | | | | | RVCT has problems with scoping, the similar workaround has been used in qhash.h also. Reviewed-by: Janne Koskinen
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-311-13/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
| * Update tech preview license header.Jason McDonald2009-08-311-13/+13
| | | | | | | | Reviewed-by: Trust Me
| * Update license headers.Jason McDonald2009-08-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
| * Disable the pointer tracking feature in Qt 4.5.Thiago Macieira2009-07-271-6/+0
| | | | | | | | | | | | | | | | The functionality is broken, since pointers can be released by a QSharedPointer tracking a pointer of different type, which would leave behind pointers in the hash. The fix requires Qt 4.6 because of a new symbol being added.
* | Add an opt-in QWeakPointer::operator->.Thiago Macieira2009-08-311-0/+4
| | | | | | | | | | | | | | To use this, you must add #define QWEAKPOINTER_ENABLE_ARROW to your .cpp before #including any headers. Be careful about adding this to .h files. Reviewed-by: Olivier Goffart
* | Mark the QSharedPointer with Qt::Uninitialized explicitThiago Macieira2009-08-281-1/+1
| | | | | | | | | | | | | | That ensures we don't create ambiguities. QSharedPointer shouldn't have any implicit constructors. Suggested-By: Olivier Goffart
* | compile when bootstrapping QtHarald Fernengel2009-08-201-0/+2
| |
* | Merge commit 'qt/master'Jason Barron2009-08-181-20/+56
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/src/examples.qdoc doc/src/plugins-howto.qdoc doc/src/topics.qdoc examples/phonon/musicplayer/mainwindow.cpp src/3rdparty/freetype/src/base/ftobjs.c src/corelib/global/qglobal.h src/corelib/tools/qalgorithms.h src/corelib/tools/qshareddata.cpp src/corelib/tools/qsharedpointer.cpp src/corelib/tools/tools.pri src/corelib/xml/qxmlstream.h src/gui/painting/painting.pri src/gui/widgets/qdatetimeedit.cpp tests/auto/qdesktopservices/qdesktopservices.pro tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp tests/auto/qtextcodec/test/test.pro
| * | Reimplement qSwap and Q_DECLARE_SHARED differently.Thiago Macieira2009-08-141-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | This enables the use of Q_DECLARE_SHARED with d-pointers that are QExplicitlySharedDataPointer<PrivateClass>. Also, this enables swapping atomically QSharedPointers. Reviewed-by: Harald Fernengel
| * | Internal doc: explain how QSharedPointer worksThiago Macieira2009-08-131-18/+39
| | |
* | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-publicJason Barron2009-08-131-2/+2
|\ \ \
| * | | Worked around RVCT scoping issues by making scope explicit in places thatMiikka Heikkinen2009-08-131-2/+2
| | | | | | | | | | | | | | | | the compiler couldn't figure out when building qsharedpointer test.
* | | | Merge commit 'qt/master'Jason Barron2009-08-131-1/+22
|\ \ \ \ | |/ / / |/| / / | |/ / | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/samplebuffers/glwidget.cpp src/corelib/io/qfsfileengine_unix.cpp src/corelib/kernel/qobject.cpp src/corelib/tools/qsharedpointer.cpp src/gui/gui.pro tests/auto/qhttp/tst_qhttp.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp
| * | Add the typedefs to QSharedPointer and QWeakPointer to make templateThiago Macieira2009-08-121-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usage simpler. For example, this allows writing code like: template <class Pointer> typename Pointer::pointer getPointer(constPointer &p) { return p.data(); } and that code will work for both QSharedPointer and QWeakPointer. Reviewed-by: Harald Fernengel Also add an operator- to make pointer operations possible.
| * | Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | | | | | | | | | Reviewed-by: Trust Me
* | | Merge commit 'qt/master-stable'Jason Barron2009-08-101-49/+51
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qobject.cpp src/corelib/tools/qsharedpointer_impl.h src/gui/widgets/qdatetimeedit.cpp src/gui/widgets/qlinecontrol.cpp src/gui/widgets/qlineedit.cpp tests/auto/qcssparser/qcssparser.pro tests/auto/qicoimageformat/tst_qicoimageformat.cpp tests/auto/qmultiscreen/qmultiscreen.pro tests/auto/qresourceengine/qresourceengine.pro tests/auto/qresourceengine/tst_qresourceengine.cpp tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp