axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Hawkins (JIRA)" <axis-c-...@ws.apache.org>
Subject [jira] Commented: (AXISCPP-318) Checking that pointers are valid before using
Date Fri, 15 Jul 2005 12:44:12 GMT
    [ http://issues.apache.org/jira/browse/AXISCPP-318?page=comments#action_12315911 ] 

John Hawkins commented on AXISCPP-318:
--------------------------------------

Is this still an issue - looks like we've done a code-trawl?

> Checking that pointers are valid before using
> ---------------------------------------------
>
>          Key: AXISCPP-318
>          URL: http://issues.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://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message