473,233 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,233 software developers and data experts.

what might destroy an object that is a member of another object

At the top of one class I declare a security object:

var $securityObject = null;

In the constructor, I initialize a bunch of member objects. Because
I've had trouble with the security object, I also test to make sure it
has been initialized:
function IntfCommands() {

$this->resultsObject->notes("We are now at the beginning of the
constructor for IntfCommands.");

$this->pageInfoObject = & $this->core->getObject("McPageInfo", "
$this->selectObject = & $this->core->getObject("ExteriorSelect",
$this->arrangementsObject = &
$this->core->getObject("McArrangements", "IntfCommands");
$this->validationObject = &
$this->core->getObject("ExteriorValidation", "IntfCommands");
$this->userObject = & $this->core->getObject("McUsers",
$this->optionsObject = & $this->core->getObject("SingletonOptions",
$this->fetchObject = & $this->core->getObject("ExteriorFetch",
$this->securityObject = & $this->core->getObject("ExteriorSecurity",
$this->outputObject = & $this->core->getObject("ExteriorOutput",
$this->fileObject = & $this->core->getObject("ExteriorFile",

if (is_object($this->fileObject)) {
} else {
$this->resultsObject->error("In the constructor of IntfCommands we
could not get an instance of ExteriorFile.", "IntfCommands");

if (!is_object($this->validationObject)) {
$this->resultsObject->error("In the constructor of IntfCommands, we
were unable to get the ExteriorValidation object.", "IntfCommands");

if (!is_object($this->securityObject)) {
$this->resultsObject->error("In the constructor of IntfCommands, we
were unable to get the ExteriorSecurity object.", "IntfCommands");
$this->resultsObject->notes("We are now at the end of the constructor
for IntfCommands.");

The error never shows up. And yet, later on, when I call a class
method, I get the error that says there is no security object:

function testSecurity($command=false) {
if ($command) {
if (is_object($this->securityObject)) {
$isThisSecure = $this->securityObject->check($command);
return $isThisSecure;
} else {
$this->core->error("In testSecurity(), in IntfCommands, there was
no security object, so we could not test the security for command
'$command'.", "IntfCommands");
} else {
$this->resultsObject->error("In testSecurity(), in IntfCommands, we
expected to be given a command name, but we were not.",
return false;

So this object passes the is_object() test up in the constructor, but
then fails later on when the method is called.

What kinds of things might destroy that object in between? What should
I look for in my code. I already ran a search for unset() but got

Jul 22 '05 #1
0 1107

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Rob | last post by:
My first GUI so be gentle... When I start my program I call a class that runs the initial window. While in this class if a certain button is pressed it calls a function outside the class. This...
by: Minkyu Kim | last post by:
Hi. Please check this simple test code. --------------------- class TestA: def __init__(self): print "init TestA" def __del__(self): print "del TestA" def SetEvent(self, event):
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. ...
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a...
by: Peter Oliphant | last post by:
I'd like to be able to destroy a Timer in it's own event handler. That is, within it's tick handler I'd like to delete the Timer itself (e.g., for one-shot timers). Is this possible? In general,...
by: ypjofficial | last post by:
Hello all, I have written a class with many private data members.and i am putting it in a separate dll file. Now when i link that file while writing my main program module,natuarally i have to...
by: grizggg | last post by:
I have searched and not found an answer to this question. I ran upon the following statement in a *.cpp file in a member function: static const char * const pacz_HTMLContentTypeHeader =...
by: Jess | last post by:
Hello, I understand the default-initialization happens if we don't initialize an object explicitly. I think for an object of a class type, the value is determined by the constructor, and for...
by: darren | last post by:
Hi I have to write a multi-threaded program. I decided to take an OO approach to it. I had the idea to wrap up all of the thread functions in a mix-in class called Threadable. Then when an...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.