summaryrefslogtreecommitdiff
path: root/ace/POSIX_Asynch_IO.cpp
diff options
context:
space:
mode:
authoralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-27 01:58:29 +0000
committeralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-27 01:58:29 +0000
commit3b3f91021dd7471c1a7dac4bdb0c3d5a6663ebc9 (patch)
tree166f3642cc3d00a509cf5404c4a65d88618f3294 /ace/POSIX_Asynch_IO.cpp
parented0c8edea6dd213df4b0bb776d464ed5784e9932 (diff)
downloadATCD-3b3f91021dd7471c1a7dac4bdb0c3d5a6663ebc9.tar.gz
Fixed the double deletion problem of the result classes. Thanks to
"Nesbitt, Bill" <bnesbitt@magellan.com> for reporting this.
Diffstat (limited to 'ace/POSIX_Asynch_IO.cpp')
-rw-r--r--ace/POSIX_Asynch_IO.cpp96
1 files changed, 62 insertions, 34 deletions
diff --git a/ace/POSIX_Asynch_IO.cpp b/ace/POSIX_Asynch_IO.cpp
index 514f80e7864..cec534b1ca1 100644
--- a/ace/POSIX_Asynch_IO.cpp
+++ b/ace/POSIX_Asynch_IO.cpp
@@ -419,8 +419,10 @@ ACE_POSIX_AIOCB_Asynch_Read_Stream::read (ACE_Message_Block &message_block,
-1);
ssize_t return_val = this->shared_read (result);
+
if (return_val == -1)
delete result;
+
return return_val;
}
@@ -486,9 +488,9 @@ ACE_POSIX_AIOCB_Asynch_Read_Stream::open (ACE_Handler &handler,
ACE_Proactor *proactor)
{
return ACE_POSIX_Asynch_Operation::open (handler,
- handle,
- completion_key,
- proactor);
+ handle,
+ completion_key,
+ proactor);
}
int
@@ -533,8 +535,10 @@ ACE_POSIX_SIG_Asynch_Read_Stream::read (ACE_Message_Block &message_block,
-1);
ssize_t return_val = this->shared_read (result);
+
if (return_val == -1)
delete result;
+
return return_val;
}
@@ -578,9 +582,9 @@ ACE_POSIX_SIG_Asynch_Read_Stream::open (ACE_Handler &handler,
ACE_Proactor *proactor)
{
return ACE_POSIX_Asynch_Operation::open (handler,
- handle,
- completion_key,
- proactor);
+ handle,
+ completion_key,
+ proactor);
}
int
@@ -761,8 +765,10 @@ ACE_POSIX_AIOCB_Asynch_Write_Stream::write (ACE_Message_Block &message_block,
-1);
ssize_t return_val = this->shared_write (result);
+
if (return_val == -1)
delete result;
+
return return_val;
}
@@ -820,9 +826,9 @@ ACE_POSIX_AIOCB_Asynch_Write_Stream::open (ACE_Handler &handler,
ACE_Proactor *proactor)
{
return ACE_POSIX_Asynch_Operation::open (handler,
- handle,
- completion_key,
- proactor);
+ handle,
+ completion_key,
+ proactor);
}
int
@@ -866,8 +872,10 @@ ACE_POSIX_SIG_Asynch_Write_Stream::write (ACE_Message_Block &message_block,
-1);
ssize_t return_val = this->shared_write (result);
+
if (return_val == -1)
delete result;
+
return return_val;
}
@@ -911,9 +919,9 @@ ACE_POSIX_SIG_Asynch_Write_Stream::open (ACE_Handler &handler,
ACE_Proactor *proactor)
{
return ACE_POSIX_Asynch_Operation::open (handler,
- handle,
- completion_key,
- proactor);
+ handle,
+ completion_key,
+ proactor);
}
int
@@ -1113,7 +1121,12 @@ ACE_POSIX_AIOCB_Asynch_Read_File::read (ACE_Message_Block &message_block,
signal_number),
-1);
- return this->shared_read (result);
+ ssize_t return_val = this->shared_read (result);
+
+ if (return_val == -1)
+ delete result;
+
+ return return_val;
}
ACE_POSIX_AIOCB_Asynch_Read_File::~ACE_POSIX_AIOCB_Asynch_Read_File (void)
@@ -1145,9 +1158,9 @@ ACE_POSIX_AIOCB_Asynch_Read_File::open (ACE_Handler &handler,
ACE_Proactor *proactor)
{
return ACE_POSIX_Asynch_Operation::open (handler,
- handle,
- completion_key,
- proactor);
+ handle,
+ completion_key,
+ proactor);
}
int
@@ -1195,7 +1208,12 @@ ACE_POSIX_SIG_Asynch_Read_File::read (ACE_Message_Block &message_block,
signal_number),
-1);
- return this->shared_read (result);
+ ssize_t return_val = this->shared_read (result);
+
+ if (return_val == -1)
+ delete result;
+
+ return return_val;
}
int
@@ -1227,9 +1245,9 @@ ACE_POSIX_SIG_Asynch_Read_File::open (ACE_Handler &handler,
ACE_Proactor *proactor)
{
return ACE_POSIX_Asynch_Operation::open (handler,
- handle,
- completion_key,
- proactor);
+ handle,
+ completion_key,
+ proactor);
}
int
@@ -1429,7 +1447,12 @@ ACE_POSIX_AIOCB_Asynch_Write_File::write (ACE_Message_Block &message_block,
signal_number),
-1);
- return this->shared_write (result);
+ ssize_t return_val = this->shared_write (result);
+
+ if (return_val == -1)
+ delete result;
+
+ return return_val;
}
ACE_POSIX_AIOCB_Asynch_Write_File::~ACE_POSIX_AIOCB_Asynch_Write_File (void)
@@ -1461,9 +1484,9 @@ ACE_POSIX_AIOCB_Asynch_Write_File::open (ACE_Handler &handler,
ACE_Proactor *proactor)
{
return ACE_POSIX_Asynch_Operation::open (handler,
- handle,
- completion_key,
- proactor);
+ handle,
+ completion_key,
+ proactor);
}
int
@@ -1511,7 +1534,12 @@ ACE_POSIX_SIG_Asynch_Write_File::write (ACE_Message_Block &message_block,
signal_number),
-1);
- return this->shared_write (result);
+ ssize_t return_val = this->shared_write (result);
+
+ if (return_val == -1)
+ delete result;
+
+ return return_val;
}
ACE_POSIX_SIG_Asynch_Write_File::~ACE_POSIX_SIG_Asynch_Write_File (void)
@@ -1543,9 +1571,9 @@ ACE_POSIX_SIG_Asynch_Write_File::open (ACE_Handler &handler,
ACE_Proactor *proactor)
{
return ACE_POSIX_Asynch_Operation::open (handler,
- handle,
- completion_key,
- proactor);
+ handle,
+ completion_key,
+ proactor);
}
int
@@ -3211,9 +3239,9 @@ ACE_POSIX_AIOCB_Asynch_Transmit_File::open (ACE_Handler &handler,
ACE_Proactor *proactor)
{
return ACE_POSIX_Asynch_Operation::open (handler,
- handle,
- completion_key,
- proactor);
+ handle,
+ completion_key,
+ proactor);
}
int
@@ -3324,9 +3352,9 @@ ACE_POSIX_SIG_Asynch_Transmit_File::open (ACE_Handler &handler,
ACE_Proactor *proactor)
{
return ACE_POSIX_Asynch_Operation::open (handler,
- handle,
- completion_key,
- proactor);
+ handle,
+ completion_key,
+ proactor);
}
int