void obj_end(Library *library, File *objfile) { obj_term(); if (library) { // Transfer image to library library->addObject(objfile->name->toChars(), objbuf.buf, objbuf.p - objbuf.buf); objbuf.buf = NULL; } else { // Transfer image to file objfile->setbuffer(objbuf.buf, objbuf.p - objbuf.buf); objbuf.buf = NULL; char *p = FileName::path(objfile->name->toChars()); FileName::ensurePathExists(p); //mem.free(p); //printf("write obj %s\n", objfile->name->toChars()); objfile->writev(); } objbuf.pend = NULL; objbuf.p = NULL; objbuf.len = 0; objbuf.inc = 0; }
void LibObject::term() { setup_completed_ = false; if( timer_ ) delete timer_; timer_ = NULL; while( !classes_.isEmpty() ) { LibClass *lib_class = classes_.takeFirst(); id().postAppEvent( new EventClassRemoved( lib_class->id() ) ); delete lib_class; } if( id().isValid() ) { id_.setLibObject(0); id_.clear(); obj_term(); } else qWarning() << "LibObject::term()" << metaObject()->className() << objectName() << "has no id"; }