Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Side by Side Diff: Source/modules/webaudio/AudioSummingJunction.cpp

Issue 802593004: WebAudio: Fix AudioNode leak in a case that AudioNode is not disconnected from the graph explicitly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, Google 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 m_context->removeMarkedSummingJunction(this); 49 m_context->removeMarkedSummingJunction(this);
50 } 50 }
51 51
52 AudioSummingJunction::~AudioSummingJunction() 52 AudioSummingJunction::~AudioSummingJunction()
53 { 53 {
54 } 54 }
55 55
56 DEFINE_TRACE(AudioSummingJunction) 56 DEFINE_TRACE(AudioSummingJunction)
57 { 57 {
58 visitor->trace(m_context); 58 visitor->trace(m_context);
59 // FIXME: Oilpan: m_renderingOutputs should not be strong references. This
60 // is a short-term workaround to avoid crashes, and causes AudioNode leaks.
61 AudioContext::AutoLocker locker(m_context);
62 for (size_t i = 0; i < m_renderingOutputs.size(); ++i)
63 visitor->trace(m_renderingOutputs[i]);
64 } 59 }
65 60
66 void AudioSummingJunction::changedOutputs() 61 void AudioSummingJunction::changedOutputs()
67 { 62 {
68 ASSERT(context()->isGraphOwner()); 63 ASSERT(context()->isGraphOwner());
69 if (!m_renderingStateNeedUpdating && !m_didCallDispose) { 64 if (!m_renderingStateNeedUpdating && !m_didCallDispose) {
70 context()->markSummingJunctionDirty(this); 65 context()->markSummingJunctionDirty(this);
71 m_renderingStateNeedUpdating = true; 66 m_renderingStateNeedUpdating = true;
72 } 67 }
73 } 68 }
(...skipping 13 matching lines...) Expand all
87 82
88 didUpdate(); 83 didUpdate();
89 84
90 m_renderingStateNeedUpdating = false; 85 m_renderingStateNeedUpdating = false;
91 } 86 }
92 } 87 }
93 88
94 } // namespace blink 89 } // namespace blink
95 90
96 #endif // ENABLE(WEB_AUDIO) 91 #endif // ENABLE(WEB_AUDIO)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698