OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // With Oilpan enabled, objects may end up being finalized without | 82 // With Oilpan enabled, objects may end up being finalized without |
83 // having been detached first. Consequently, the objects force | 83 // having been detached first. Consequently, the objects force |
84 // detachment first before deleting the platform object. Without | 84 // detachment first before deleting the platform object. Without |
85 // Oilpan, the objects will have been detached from the 'parent' | 85 // Oilpan, the objects will have been detached from the 'parent' |
86 // objects first and do not separately require it when finalizing. | 86 // objects first and do not separately require it when finalizing. |
87 // | 87 // |
88 // However, as detach() is trivial, the individual WebGL | 88 // However, as detach() is trivial, the individual WebGL |
89 // destructors will always call detachAndDeleteObject() rather | 89 // destructors will always call detachAndDeleteObject() rather |
90 // than do it based on Oilpan being enabled. | 90 // than do it based on Oilpan being enabled. |
91 detach(); | 91 detach(); |
92 deleteObject(0); | 92 deleteObject(nullptr); |
93 } | 93 } |
94 | 94 |
95 void WebGLObject::onDetached(blink::WebGraphicsContext3D* context3d) | 95 void WebGLObject::onDetached(blink::WebGraphicsContext3D* context3d) |
96 { | 96 { |
97 if (m_attachmentCount) | 97 if (m_attachmentCount) |
98 --m_attachmentCount; | 98 --m_attachmentCount; |
99 if (m_deleted) | 99 if (m_deleted) |
100 deleteObject(context3d); | 100 deleteObject(context3d); |
101 } | 101 } |
102 | 102 |
103 } | 103 } |
OLD | NEW |