Destroy and remove all remaining objects. This is valuable for closing
down all Allocated objects cleanly for exiting. It is also a good method
for removing objects when, for instance, all Objects are invalid because
of broken connections, etc.
166434
public void drain() {
		synchronized (list) {
			for (int i = 0; i < list.size(); ++i) {
				Pooled<T> pt = list.remove();
				creator.destroy(pt.content);
				pt.logTarget.log("Pool drained ", creator.toString());
			}
			count = spares = 0;
		}

	}
1005601
def delete_all
      # delete individual objects one by one, making sure to delete all accessors as well
      returns = {}
      @_componentable_container.each do |key, val|
        delete!(key)
        returns[key] = val
      end
      returns
    end
18481
public void destroy()
    {
        Iterator iter = _nameMap.values().iterator();
        while (iter.hasNext())
        {
            Object sh=iter.next();
            iter.remove();
            removeComponent(sh);
        }
        
        if (_sessionManager!=null)
            removeComponent(_sessionManager);
        _sessionManager=null;
        _context=null;
        super.destroy();
    }
566547
public boolean deleteObject (ObjectInfo info)
    {
        int oidx = -1;
        for (int ii = 0; ii < _objects.length; ii++) {
            if (_objects[ii].info.equals(info)) {
                oidx = ii;
                break;
            }
        }
        if (oidx == -1) {
            return false;
        }
        _objects = ArrayUtil.splice(_objects, oidx, 1);

        // clear out our neighbors array so that the subsequent update
        // causes us to recompute our coverage
        Arrays.fill(_neighbors, null);
        return true;
    }
1021401
def destroy(self, request, *args, **kwargs):
        
        obj = self.get_object()
        user = request.user

        if strtobool(request.query_params.get('delete_content', 'false')):
            for data in obj.data.all():
                if user.has_perm('edit_data', data):
                    data.delete()

            # If all data objects in an entity are removed, the entity may
            # have already been removed, so there is no need to call destroy.
            if not Entity.objects.filter(pk=obj.pk).exists():
                return Response(status=status.HTTP_204_NO_CONTENT)

        # NOTE: Collection's ``destroy`` method should be skiped, so we
        # intentionaly call it's parent.
        return super(CollectionViewSet, self).destroy(  # pylint: disable=no-member,bad-super-call
            request, *args, **kwargs
        )
379415
public function destroyAll()
	{
		// @FIXME: could make this a single query...
		if ($this->count())
		{
			foreach ($this->rows as $model)
			{
				if (!$model->destroy())
				{
					$this->setErrors($model->getErrors());
					return false;
				}
			}
		}

		return true;
	}
103900
def destroy(self):
        
        self._check_if_ready()
        self.collection.stop()
        self.main_loop.join()
        self.main_loop = None
        self.collection.clear()
1205998
function destroy(obj) {
    for (var i in obj) {
        if (obj.hasOwnProperty(i) && obj[i]) {
            if ($.isArray(obj[i])) {
                obj[i].length = 0;
            }
            if ($.isFunction(obj[i].destroy)) {
                obj[i].destroy();
            }
            delete obj[i];
        }
    }
}
480503
@Override
    public void destroy() {
        synchronized (channels) {
            isCurrentlyShutingDown = true;
            for (final SynchronizeFXTomcatChannel server : channels.values()) {
                server.shutdown();
            }
            servers.clear();
            channels.clear();
            isCurrentlyShutingDown = false;

        }
    }
523440
function destroy() {
         // allow recycling object properties
         me.pool.push(this.currentTransform);
         this.currentTransform = undefined;
         me.pool.push(this.anchorPoint);
         this.anchorPoint = undefined;
         me.pool.push(this.pos);
         this.pos = undefined;
         me.pool.push(this._absPos);
         this._absPos = undefined;
         me.pool.push(this._bounds);
         this._bounds = undefined;
         this.onVisibilityChange = undefined;

         if (typeof this.mask !== "undefined") {
           me.pool.push(this.mask);
           this.mask = undefined;
         }

         if (typeof this.tint !== "undefined") {
           me.pool.push(this.tint);
           this.tint = undefined;
         }

         this.ancestor = undefined; // destroy the physic body if defined

         if (typeof this.body !== "undefined") {
           this.body.destroy.apply(this.body, arguments);
           this.body = undefined;
         }

         this.onDestroyEvent.apply(this, arguments);
       }
630017
void closeAndClear() {
		for (Algorithm a : this.idsToAlgorithms.values()) {
			a.close();
		}
		idsToAlgorithms.clear();
		algorithms = null;
	}
599983
def _teardown(self):
        '''
        
        '''
        if not self._was_object_method:
            setattr(self._instance, self._attr, self._obj)
        else:
            delattr(self._instance, self._attr)
877525
@Override
	public void remove() {
		try {
			removeThrow();
		} catch (SQLException e) {
			closeQuietly();
			// unfortunately, can't propagate back the SQLException
			throw new IllegalStateException("Could not delete " + dataClass + " object " + last, e);
		}
	}
1085735
public static void destroy() {
		try {
			countMutex.acquire();
			for (int i=0;i<fileToDeleteOnDestroy.size();i++) {
				File f = (File)fileToDeleteOnDestroy.get(i);
				if (f != null && f.exists())
					try{f.delete();}catch(Exception ignore){}
			}
			CClassLoader.destroy();
		} // end try
		finally {
			countInstance = 0;

			try {
				countMutex.release();
			} // end try
			catch (final Exception e) {}
		} // end finally
	}
541642
public void destroy() {
        if (sslEngine == null) {
            return;
        }

        // Close inbound and flush all remaining data if available.
        try {
            sslEngine.closeInbound();
        } catch (SSLException e) {
            LOGGER.debug(
                    "Unexpected exception from SSLEngine.closeInbound().", e);
        }


        if (outNetBuffer != null) {
            outNetBuffer.capacity(sslEngine.getSession().getPacketBufferSize());
        } else {
            createOutNetBuffer(0);
        }
        try {
            do {
                outNetBuffer.clear();
            } while (sslEngine.wrap(emptyBuffer.buf(), outNetBuffer.buf()).bytesProduced() > 0);
        } catch (SSLException e) {
            // Ignore.
        } finally {
            destroyOutNetBuffer();
        }

        sslEngine.closeOutbound();
        sslEngine = null;

        preHandshakeEventQueue.clear();
    }
174405
def delete(self):
        
        with rconnect() as conn:
            # Can't delete an object without an ID.
            if self.id is None:
                raise FrinkError("You can't delete an object with no ID")
            else:
                if isinstance(self.id, uuid.UUID):
                    self.id = str(self.id)

                try:
                    query = r.db(
                        self._db
                    ).table(
                        self._table
                    ).get(
                        self.id
                    ).delete()
                    log.debug(query)
                    rv = query.run(conn)
                except Exception as e:
                    log.warn(e)
                    raise
                else:
                    return True
701931
final public function destroy()
    {
        foreach ($this->registry as $offset => $object) {
            if (method_exists($object, '__destruct')) {
                $object->__destruct();
            }
            unset($this->registry[ $offset ]);
        }
    }