From patchwork Tue Jun 11 22:44:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barker X-Patchwork-Id: 17803 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E66F125E1A for ; Tue, 11 Jun 2013 22:44:19 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cr7sf5929573qab.5 for ; Tue, 11 Jun 2013 15:44:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to :mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state:x-original-sender :x-original-authentication-results:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=LXXyTsEyl8AMkZjwSac37Z3JBFKAXz4gVbvRK/CIfPE=; b=lJzCAeKc/xg4eIQDG2QG9CSXqiI8y5Uv37IUAKH6XEaRU1828dq4wft3V+7x9/IB9r Hmt2ztwKS7LzuZcRIK6CmHRU6+6i0Ya5GQd8r+wGpsZhtyLFcHw4oELUh20U/paKIjtU v4teE5tC+10+SezzwKY+nHKoLQ159WreCSMx2Kl6TsfHLH2upeQ+6rPW63qPQgfSjDDZ r4KDZLH3xs71VlI4oUgYD97dDlrpKH4aqMDEkjbpjJJMnDfKoK+yzlyU8/3+pBLplcSF F/8U3l/Jxne+ZzZjPROGH8oIdY+haqBC2gwXDUB4MM+IlFmyUhq0I43Yly5hU2UBRSJz a8VQ== X-Received: by 10.236.61.42 with SMTP id v30mr9572528yhc.15.1370990659651; Tue, 11 Jun 2013 15:44:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.117.104 with SMTP id kd8ls3514391qeb.93.gmail; Tue, 11 Jun 2013 15:44:19 -0700 (PDT) X-Received: by 10.220.40.212 with SMTP id l20mr8792600vce.29.1370990659312; Tue, 11 Jun 2013 15:44:19 -0700 (PDT) Received: from mail-ve0-x230.google.com (mail-ve0-x230.google.com [2607:f8b0:400c:c01::230]) by mx.google.com with ESMTPS id j3si7660319vca.67.2013.06.11.15.44.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Jun 2013 15:44:19 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::230; Received: by mail-ve0-f176.google.com with SMTP id c13so6112289vea.7 for ; Tue, 11 Jun 2013 15:44:19 -0700 (PDT) X-Received: by 10.58.29.42 with SMTP id g10mr8590234veh.59.1370990659202; Tue, 11 Jun 2013 15:44:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.10.206 with SMTP id pb14csp128276vcb; Tue, 11 Jun 2013 15:44:18 -0700 (PDT) X-Received: by 10.180.210.137 with SMTP id mu9mr2664571wic.38.1370990658002; Tue, 11 Jun 2013 15:44:18 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id dh3si5391105wjc.164.2013.06.11.15.44.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 11 Jun 2013 15:44:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1UmXIX-0005pV-9M for ; Tue, 11 Jun 2013 22:44:17 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 32F97E048E for ; Tue, 11 Jun 2013 22:44:17 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glmark2 X-Launchpad-Branch: ~glmark2-dev/glmark2/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 275 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 275: CanvasGeneric: Check buffer object handles before calling delete. While it is Message-Id: <20130611224417.31054.28680.launchpad@ackee.canonical.com> Date: Tue, 11 Jun 2013 22:44:17 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16667"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 7d83c76ee3d9e4f3fc23893fc14cf03faadc7810 X-Gm-Message-State: ALoCoQnhhhBxDkLw4Gx54lrA8bJwiZcj5QReI0kHOns/6rIk2a8tfpmZXIAsufuJ4/Q0ICjEj69o X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , ------------------------------------------------------------ revno: 275 committer: Jesse Barker branch nick: trunk timestamp: Tue 2013-06-11 15:40:02 -0700 message: CanvasGeneric: Check buffer object handles before calling delete. While it is perfectly legal and harmless to delete an object handle of zero, there are times when we do this before having made a context current, which _should_ be harmless (because implementations don't like to crash), but it not really cool. modified: src/canvas-generic.cpp --- lp:glmark2 https://code.launchpad.net/~glmark2-dev/glmark2/trunk You are subscribed to branch lp:glmark2. To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription === modified file 'src/canvas-generic.cpp' --- src/canvas-generic.cpp 2013-03-04 19:07:07 +0000 +++ src/canvas-generic.cpp 2013-06-11 22:40:02 +0000 @@ -409,12 +409,18 @@ void CanvasGeneric::release_fbo() { - glDeleteFramebuffers(1, &fbo_); - glDeleteRenderbuffers(1, &color_renderbuffer_); - glDeleteRenderbuffers(1, &depth_renderbuffer_); - fbo_ = 0; - color_renderbuffer_ = 0; - depth_renderbuffer_ = 0; + if (fbo_) { + glDeleteFramebuffers(1, &fbo_); + fbo_ = 0; + } + if (!color_renderbuffer_) { + glDeleteRenderbuffers(1, &color_renderbuffer_); + color_renderbuffer_ = 0; + } + if (!depth_renderbuffer_) { + glDeleteRenderbuffers(1, &depth_renderbuffer_); + depth_renderbuffer_ = 0; + } gl_color_format_ = 0; gl_depth_format_ = 0;