mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
intel_winsys: Fix intel_buffer_reference.
Correctly clear the pointer to the old buffer (not sure how this could build at all before...) and only reference the new one when its pointer is non-NULL.
This commit is contained in:
parent
c01a5ec3d6
commit
d59c95bfae
1 changed files with 5 additions and 3 deletions
|
|
@ -91,11 +91,13 @@ intel_buffer_reference(struct pipe_winsys *sws,
|
|||
{
|
||||
if (*ptr) {
|
||||
driBOUnReference( dri_bo(*ptr) );
|
||||
*buf = NULL;
|
||||
*ptr = NULL;
|
||||
}
|
||||
|
||||
driBOReference( dri_bo(buf) );
|
||||
*ptr = buf;
|
||||
if (buf) {
|
||||
driBOReference( dri_bo(buf) );
|
||||
*ptr = buf;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue