You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org> on 2004/12/10 02:17:17 UTC
[jira] Commented: (AXISCPP-318) Checking that pointers are valid before using
[ http://nagoya.apache.org/jira/browse/AXISCPP-318?page=comments#action_56485 ]
Samisa Abeysinghe commented on AXISCPP-318:
-------------------------------------------
Can we use a set of globle macros for this?
> Checking that pointers are valid before using
> ---------------------------------------------
>
> Key: AXISCPP-318
> URL: http://nagoya.apache.org/jira/browse/AXISCPP-318
> Project: Axis-C++
> Type: Improvement
> Components: Basic Architecture
> Versions: 1.5 Alpha
> Environment: n/a
> Reporter: Fred Preston
>
> Pointer Improvements
> --------------------
> I would like the following pointer improvements. This is mainly to do with ensuring that a pointer will always be valid if it is not NULL.
> Rule1
> =====
> On creation, unless a pointer is assigned a value it must be set to NULL.
> example:
> Test * pTest = NULL;
> or
> Test * pTest = new Test();
> Rule2
> =====
> Before using a pointer, it is tested to check that it is not NULL.
> example:
> if( pTest != NULL)
> {
> bool bResult = pTest->method1( iValue);
> }
> or
> if( pTest != NULL)
> {
> bool bResult = pTest->method1( iValue);
> if( bResult == true)
> {
> pTest->method2( sValue);
> }
> }
> Rule3
> =====
> On deletion, the pointer is set to NULL.
> example:
> if( pTest != NULL)
> {
> delete pTest;
> pTest = NULL;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira