if (vao) {
/* reference new array object */
mtx_lock(&vao->Mutex);
- if (vao->RefCount == 0) {
- /* this array's being deleted (look just above) */
- /* Not sure this can every really happen. Warn if it does. */
- _mesa_problem(NULL, "referencing deleted array object");
- *ptr = NULL;
- }
- else {
- vao->RefCount++;
- *ptr = vao;
- }
+ assert(vao->RefCount > 0);
+
+ vao->RefCount++;
+ *ptr = vao;
mtx_unlock(&vao->Mutex);
}
}
if (bufObj) {
/* reference new buffer */
mtx_lock(&bufObj->Mutex);
- if (bufObj->RefCount == 0) {
- /* this buffer's being deleted (look just above) */
- /* Not sure this can every really happen. Warn if it does. */
- _mesa_problem(NULL, "referencing deleted buffer object");
- *ptr = NULL;
- }
- else {
- bufObj->RefCount++;
- *ptr = bufObj;
- }
+ assert(bufObj->RefCount > 0);
+
+ bufObj->RefCount++;
+ *ptr = bufObj;
mtx_unlock(&bufObj->Mutex);
}
}
if (obj) {
/* reference new pipeline object */
mtx_lock(&obj->Mutex);
- if (obj->RefCount == 0) {
- /* this pipeline's being deleted (look just above) */
- /* Not sure this can ever really happen. Warn if it does. */
- _mesa_problem(NULL, "referencing deleted pipeline object");
- *ptr = NULL;
- }
- else {
- obj->RefCount++;
- *ptr = obj;
- }
+ assert(obj->RefCount > 0);
+
+ obj->RefCount++;
+ *ptr = obj;
mtx_unlock(&obj->Mutex);
}
}
if (samp) {
/* reference new sampler */
mtx_lock(&samp->Mutex);
- if (samp->RefCount == 0) {
- /* this sampler's being deleted (look just above) */
- /* Not sure this can every really happen. Warn if it does. */
- _mesa_problem(NULL, "referencing deleted sampler object");
- *ptr = NULL;
- }
- else {
- samp->RefCount++;
- *ptr = samp;
- }
+ assert(samp->RefCount > 0);
+
+ samp->RefCount++;
+ *ptr = samp;
mtx_unlock(&samp->Mutex);
}
}
/* reference new texture */
assert(valid_texture_object(tex));
mtx_lock(&tex->Mutex);
- if (tex->RefCount == 0) {
- /* this texture's being deleted (look just above) */
- /* Not sure this can every really happen. Warn if it does. */
- _mesa_problem(NULL, "referencing deleted texture object");
- *ptr = NULL;
- }
- else {
- tex->RefCount++;
- *ptr = tex;
- }
+ assert(tex->RefCount > 0);
+
+ tex->RefCount++;
+ *ptr = tex;
mtx_unlock(&tex->Mutex);
}
}
assert(!*ptr);
if (obj) {
+ assert(obj->RefCount > 0);
+
/* reference new object */
- if (obj->RefCount == 0) {
- _mesa_problem(NULL, "referencing deleted transform feedback object");
- *ptr = NULL;
- }
- else {
- obj->RefCount++;
- obj->EverBound = GL_TRUE;
- *ptr = obj;
- }
+ obj->RefCount++;
+ obj->EverBound = GL_TRUE;
+ *ptr = obj;
}
}