Issue 79056 - vos: OAcceptorSocket dtor and base dtor both attempt to delete the socket
Summary: vos: OAcceptorSocket dtor and base dtor both attempt to delete the socket
Alias: None
Product: udk
Classification: Code
Component: code (show other issues)
Version: OOo 2.2.1
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 2.3
Assignee: hennes.rohling
QA Contact: issues@udk
Depends on:
Reported: 2007-07-01 17:35 UTC by caolanm
Modified: 2007-08-27 10:55 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---

patch to avoid (459 bytes, patch)
2007-07-01 17:35 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2007-07-01 17:35:21 UTC
So it looks to me that if you destruct vos: OAcceptorSocket it will delete the
socket, and then OSocket's dtor will then be called which also attempt to
reference the deleted socket to close it.

How about this minimal patch
Comment 1 caolanm 2007-07-01 17:35:41 UTC
Created attachment 46409 [details]
patch to avoid
Comment 2 kay.ramme 2007-07-02 12:04:29 UTC
->Caolan: Couldn't we just move the "osl_closeSocket" call to "OSocket::close"
and completely remove "OAcceptorSocket::~OAcceptorSocket" ? Anyway, reassigned
to Hennes ...
Comment 3 kay.ramme 2007-07-04 14:34:08 UTC
Comment 4 hennes.rohling 2007-07-11 12:54:29 UTC
Simple enough to make it into 2.3 ;-)
Comment 5 hennes.rohling 2007-07-11 13:40:48 UTC
Removing ~OAcceptorSocket would make the change incompatible.

Furthermore: close() is a virtual method of OAcceptorSocket and calling close()
from base dtor will call OScoket::close() but not OAcceptorSocket::close().

Taking Caolans patch.
Comment 6 hennes.rohling 2007-07-11 13:48:35 UTC
Fixed on CWS hropatches
Comment 7 hennes.rohling 2007-08-01 10:24:46 UTC
Verfied the patch.
Comment 8 caolanm 2007-08-27 10:55:51 UTC