Skip to content
Permalink
Browse files
2010-10-28 Balazs Kelemen <kbalazs@webkit.org>
        Reviewed by Andreas Kling.

        [Qt][WK2] SharedMemory should be released by the receiving process
        https://bugs.webkit.org/show_bug.cgi?id=48520

        * Platform/qt/SharedMemoryQt.cpp:
        (WebKit::SharedMemory::~SharedMemory):
        (WebKit::SharedMemory::createHandle):

Canonical link: https://commits.webkit.org/61290@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
balazs committed Oct 28, 2010
1 parent fc09f5b commit bb0105f30fdaa7d4c302d5ed7e34e29adee1d601
Showing 2 changed files with 19 additions and 0 deletions.
@@ -1,3 +1,14 @@
2010-10-28 Balazs Kelemen <kbalazs@webkit.org>

Reviewed by Andreas Kling.

[Qt][WK2] SharedMemory should be released by the receiving process
https://bugs.webkit.org/show_bug.cgi?id=48520

* Platform/qt/SharedMemoryQt.cpp:
(WebKit::SharedMemory::~SharedMemory):
(WebKit::SharedMemory::createHandle):

2010-10-28 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>

Reviewed by Kenneth Rohde Christiansen.
@@ -122,6 +122,11 @@ PassRefPtr<SharedMemory> SharedMemory::create(const Handle& handle, Protection p

SharedMemory::~SharedMemory()
{
if (!m_data) {
// Ownership of the mapped memory has been passed.
return;
}

MappedMemory* mappedMemory = mappedMemoryPool->searchForMappedMemory(reinterpret_cast<uchar*>(m_data));
if (mappedMemory)
mappedMemory->markFree();
@@ -140,6 +145,9 @@ bool SharedMemory::createHandle(Handle& handle, Protection protection)
handle.m_fileName = mm->file->fileName();
handle.m_size = m_size;

// Hand off ownership of the mapped memory to the receiving process.
m_data = 0;

return true;
}

0 comments on commit bb0105f

Please sign in to comment.