예제 #1
0
void Pixmap::reference(const Pixmap& p_pixmap) {

	unreference();

	_pp=p_pixmap._pp;

	if (_pp) {
		
		_pp->refcount++;
	}	
}
예제 #2
0
bool Reference::init_ref() {

	if (reference()) {

		// this may fail in the scenario of two threads assigning the pointer for the FIRST TIME
		// at the same time, which is never likely to happen (would be crazy to do)
		// so don't do it.

		if (refcount_init.get() > 0) {
			refcount_init.unref();
			unreference(); // first referencing is already 1, so compensate for the ref above
		}

		return true;
	} else {

		return false;
	}
}
예제 #3
0
Pixmap::~Pixmap() {

	unreference();
	
}