Why you should be avoiding using stale pointers

Tutorials Shared by the Internet Community


  Top Tutorials     New Tutorials     Submit     Login     Register  

Why you should be avoiding using stale pointers

This unit, of course, does nothing to the VCL, so you can still get stale pointers back from the VCL...
  • Total Hits: 22278

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating


  • Total Votes: 154 votes

  • Category: Delphi/Delphi Misc

  • Submitted on: 2008-04-16 06:47:23

  • Submitted By: Shekhar

  • Set as Favorite


I've written a very simple unit, and devised some simple methods, to help prevent the usage of stale pointers. My biggest recommendation is to add an 'initialization' section to ALL UNITS WHICH CONTAIN POINTER OR OBJECT VARIABLES and set all the pointers (object variables are really pointers too) to nil. This will ensure that the pointers are all nilified before they are ever used.    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 37.01%  57
 Two starsTwo star  Vote LeftVote MiddleVote Right 11.04%  17
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 12.34%  19
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 11.69%  18
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 27.92%  43

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.