[pdp-discuss] TypeAccess question?

Richard Jones dickjr at gmail.com
Tue Nov 14 18:58:29 MST 2006


I've been having a recurring problem with my code.  Every now and then
I am getting core dumps while in executing in:

String TypeDef::GetValStr(...)

This will usually be when I want to open an edit dialog on a newly
created object, such as a layer.  It also happens if I try to save my
project after newly creating an object.  This latter is a disaster
since it writes out a corrupt proj.gz file and work is lost.   It
doesn't happen under all circumstances, but I've got it boiled down to
reproducibility.  Consider the following class:

  class TestLayer : public Layer {

  public:

       MemberDef*	var_md;	
	
	  void	UpdateAfterEdit() {};
	  void	Initialize() { var_md = NULL;};
	  void 	Destroy()		{ };
	  void	InitLinks() {};
	  SIMPLE_COPY(TestLayer);
	  COPY_FUNS(TestLayer, Layer);
	  TA_BASEFUNS(TestLayer);
  };

If in NetViewer I create just one TestLayer and then try to edit it I
have no problem.  If I create two and try to edit the first, again no
problem.  But if I try to edit the second I get the dump.  Creating
one at a time doesn't seem to be a problem, most of the the time.

The problem is related to my inclusion of pointers to taBase classes.
For instance, if I remove the "MemberDef* var_md" above the problem
goes away.   There must be something I'm supposed to do but am
missing.  Any advice I could get would be greatly welcome.

Many thanks.


-- 
Richard Jones
dickjr at gmail.com


More information about the PDP-Discuss mailing list