diff options
author | Vincent Richard <[email protected]> | 2005-07-12 22:28:02 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2005-07-12 22:28:02 +0000 |
commit | 681297e10b666e13cc463f6fbb16236f36c3266c (patch) | |
tree | 5d2392e2283232ed3475cd9c69e22897b03e8a97 /src/mailboxField.cpp | |
parent | Added contentHandler::extractRaw(). (diff) | |
download | vmime-681297e10b666e13cc463f6fbb16236f36c3266c.tar.gz vmime-681297e10b666e13cc463f6fbb16236f36c3266c.zip |
Reference counting and smart pointers.
Diffstat (limited to 'src/mailboxField.cpp')
-rw-r--r-- | src/mailboxField.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mailboxField.cpp b/src/mailboxField.cpp index 3580b011..db62b36c 100644 --- a/src/mailboxField.cpp +++ b/src/mailboxField.cpp @@ -44,7 +44,7 @@ void mailboxField::parse(const string& buffer, const string::size_type position, // Here, we cannot simply call "m_mailbox.parse()" because it // may have more than one address specified (even if this field // should contain only one). We are never too much careful... - address* parsedAddress = address::parseNext(buffer, position, end, newPosition); + ref <address> parsedAddress = address::parseNext(buffer, position, end, newPosition); if (parsedAddress) { @@ -52,7 +52,7 @@ void mailboxField::parse(const string& buffer, const string::size_type position, { // If it is a group of mailboxes, take the first // mailbox of the group - mailboxGroup* group = static_cast <mailboxGroup*>(parsedAddress); + ref <mailboxGroup> group = parsedAddress.staticCast <mailboxGroup>(); if (!group->isEmpty()) getValue() = *(group->getMailboxAt(0)); @@ -60,12 +60,10 @@ void mailboxField::parse(const string& buffer, const string::size_type position, else { // Parse only if it is a mailbox - getValue() = *static_cast <mailbox*>(parsedAddress); + getValue() = *parsedAddress.staticCast <mailbox>(); } } - delete (parsedAddress); - getValue().setParsedBounds(position, end); setParsedBounds(position, end); |