aboutsummaryrefslogtreecommitdiffstats
path: root/src/mailboxField.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2005-07-12 22:28:02 +0000
committerVincent Richard <[email protected]>2005-07-12 22:28:02 +0000
commit681297e10b666e13cc463f6fbb16236f36c3266c (patch)
tree5d2392e2283232ed3475cd9c69e22897b03e8a97 /src/mailboxField.cpp
parentAdded contentHandler::extractRaw(). (diff)
downloadvmime-681297e10b666e13cc463f6fbb16236f36c3266c.tar.gz
vmime-681297e10b666e13cc463f6fbb16236f36c3266c.zip
Reference counting and smart pointers.
Diffstat (limited to 'src/mailboxField.cpp')
-rw-r--r--src/mailboxField.cpp8
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);