Пример #1
0
// this function is only called by remove_thread_resource()
// during a call, meaning that the reference count cannot reach 0,
// meaning that the close method will never be run here
void ManagedDatasource::deref() {
#ifdef DEBUG
   assert(!ROdereference());
#else
   ROdereference();
#endif
}
Пример #2
0
void QoreSocketObject::deref() {
   if (ROdereference()) {
      ExceptionSink xsink;
      priv->socket->cleanup(&xsink);
      delete this;
   }
}
Пример #3
0
void AbstractQoreNode::deref(ExceptionSink* xsink) {
   //QORE_TRACE("AbstractQoreNode::deref()");
#ifdef DEBUG
#if TRACK_REFS
   if (type == NT_OBJECT)
      printd(REF_LVL, "QoreObject::deref() %p class: %s (%d->%d) %d\n", this, ((QoreObject*)this)->getClassName(), references, references - 1, custom_reference_handlers);
   else
      printd(REF_LVL, "AbstractQoreNode::deref() %p type: %d %s (%d->%d)\n", this, type, getTypeName(), references, references - 1);

#endif
   if (references > 10000000 || references <= 0){
      if (type == NT_STRING)
	 printd(0, "AbstractQoreNode::deref() WARNING, node %p references: %d (type: %s) (val=\"%s\")\n",
		this, references, getTypeName(), ((QoreStringNode*)this)->getBuffer());
      else
	 printd(0, "AbstractQoreNode::deref() WARNING, node %p references: %d (type: %s)\n", this, references, getTypeName());
      assert(false);
   }
#endif
   assert(references > 0);

   if (there_can_be_only_one) {
      assert(is_unique());
      return;
   }

   if (custom_reference_handlers) {
      customDeref(xsink);
   }
   else if (ROdereference()) {
      if (type < NUM_SIMPLE_TYPES || derefImpl(xsink))
	 delete this;
   }
}
Пример #4
0
void SimpleQoreNode::deref() {
   if (there_can_be_only_one) {
      assert(is_unique());
      return;
   }

   if (ROdereference())
      delete this;
}
Пример #5
0
void QoreSQLStatement::deref(ExceptionSink* xsink) {
   if (ROdereference()) {
      char cmd = DAH_NOCHANGE;
      //printd(5, "QoreSQLStatement::deref() deleting this=%p cmd=%s\n", this, DAH_TEXT(cmd));
      {
         DBActionHelper dba(*this, xsink, cmd);
         if (dba)
            closeIntern(xsink);
      }

      dsh->helperDestructor(this, xsink);

      if (prepare_args)
         prepare_args->deref(xsink);

      delete this;
   }
}
Пример #6
0
void ManagedDatasource::deref(ExceptionSink *xsink) {
   if (ROdereference()) {
      close(xsink);
      delete this;
   }
}
Пример #7
0
void QoreSocketObject::deref(ExceptionSink* xsink) {
   if (ROdereference()) {
      priv->socket->cleanup(xsink);
      delete this;
   }
}
Пример #8
0
void QoreHttpClientObject::deref(ExceptionSink* xsink) {
    if (ROdereference()) {
	cleanup(xsink);
	delete this;
    }
}
Пример #9
0
void QoreProgram::deref(ExceptionSink* xsink) {
   //printd(5, "QoreProgram::deref() this: %p %d->%d\n", this, reference_count(), reference_count() - 1);
   if (ROdereference())
      priv->clear(xsink);
}