app_server: make a copy of the passed BPicture

Like the AS_DRAW_PICTURE case, make a copy of the passed BPicture also for AS_CLIP_TO_PICTURE

Change-Id: Id9a0adc48d73e5ec9c0d37e2ed85e30aa48369ab
This commit is contained in:
JackBurton79
2018-09-10 12:48:30 +02:00
parent d1311300dc
commit cb0d7a1ecd
+8 -5
View File
@@ -3700,12 +3700,15 @@ ServerWindow::_DispatchPictureMessage(int32 code, BPrivate::LinkReceiver& link)
break;
ServerPicture* pictureToClip = fServerApp->GetPicture(pictureToken);
if (pictureToClip == NULL)
break;
if (pictureToClip != NULL) {
// We need to make a copy of the picture, since it can
// change after it has been drawn
ServerPicture* copy = App()->CreatePicture(pictureToClip);
picture->NestPicture(copy);
picture->WriteClipToPicture(copy->Token(), where, inverse);
picture->WriteClipToPicture(pictureToClip->Token(), where, inverse);
pictureToClip->ReleaseReference();
pictureToClip->ReleaseReference();
}
break;
}