Commit 1e636bb6 authored by darin@apple.com's avatar darin@apple.com

* wtf/OwnArrayPtr.h:

(WTF::OwnArrayPtr::set): Fix the assertion in here to match the one in OwnPtr.
At some point someone fixed the "asserts when assigning to 0 and the pointer is
already 0" issue in OwnPtr but forgot to do it here.

Reviewed by Sam Weinig.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent dc0940bf
2010-05-30 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
* wtf/OwnArrayPtr.h:
(WTF::OwnArrayPtr::set): Fix the assertion in here to match the one in OwnPtr.
At some point someone fixed the "asserts when assigning to 0 and the pointer is
already 0" issue in OwnPtr but forgot to do it here.
2010-05-29 Geoffrey Garen <ggaren@apple.com>
Windows build fix: Updated exported symbols.
......
/*
* Copyright (C) 2006 Apple Computer, Inc.
* Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -35,7 +35,14 @@ namespace WTF {
T* get() const { return m_ptr; }
T* release() { T* ptr = m_ptr; m_ptr = 0; return ptr; }
void set(T* ptr) { ASSERT(m_ptr != ptr); safeDelete(); m_ptr = ptr; }
// FIXME: This should be renamed to adopt.
void set(T* ptr)
{
ASSERT(!ptr || m_ptr != ptr);
safeDelete();
m_ptr = ptr;
}
void clear() { safeDelete(); m_ptr = 0; }
T& operator*() const { ASSERT(m_ptr); return *m_ptr; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment