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

Side by Side Diff: src/debug.cc

Issue 7848026: Fix memory leak from debug.cc (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 9 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1947 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 1958
1959 void Debug::AfterGarbageCollection() { 1959 void Debug::AfterGarbageCollection() {
1960 // Generate events for collected scripts. 1960 // Generate events for collected scripts.
1961 if (script_cache_ != NULL) { 1961 if (script_cache_ != NULL) {
1962 script_cache_->ProcessCollectedScripts(); 1962 script_cache_->ProcessCollectedScripts();
1963 } 1963 }
1964 } 1964 }
1965 1965
1966 1966
1967 Debugger::Debugger(Isolate* isolate) 1967 Debugger::Debugger(Isolate* isolate)
1968 : debugger_access_(isolate->debugger_access()), 1968 : debugger_access_(isolate->debugger_access()),
Vitaly Repeshko 2011/09/08 17:15:50 debugger_access mutex is created by the isolate an
tfarina 2011/09/08 17:17:20 Yeah, I saw that. So it's not an issue anymore, ri
Vitaly Repeshko 2011/09/08 17:24:01 Disposing it again would mean double-deleting it.
1969 event_listener_(Handle<Object>()), 1969 event_listener_(Handle<Object>()),
1970 event_listener_data_(Handle<Object>()), 1970 event_listener_data_(Handle<Object>()),
1971 compiling_natives_(false), 1971 compiling_natives_(false),
1972 is_loading_debugger_(false), 1972 is_loading_debugger_(false),
1973 never_unload_debugger_(false), 1973 never_unload_debugger_(false),
1974 message_handler_(NULL), 1974 message_handler_(NULL),
1975 debugger_unload_pending_(false), 1975 debugger_unload_pending_(false),
1976 host_dispatch_handler_(NULL), 1976 host_dispatch_handler_(NULL),
1977 dispatch_handler_access_(OS::CreateMutex()), 1977 dispatch_handler_access_(OS::CreateMutex()),
1978 debug_message_dispatch_handler_(NULL), 1978 debug_message_dispatch_handler_(NULL),
1979 message_dispatch_helper_thread_(NULL), 1979 message_dispatch_helper_thread_(NULL),
1980 host_dispatch_micros_(100 * 1000), 1980 host_dispatch_micros_(100 * 1000),
1981 agent_(NULL), 1981 agent_(NULL),
1982 command_queue_(isolate->logger(), kQueueInitialSize), 1982 command_queue_(isolate->logger(), kQueueInitialSize),
1983 command_received_(OS::CreateSemaphore(0)), 1983 command_received_(OS::CreateSemaphore(0)),
1984 event_command_queue_(isolate->logger(), kQueueInitialSize), 1984 event_command_queue_(isolate->logger(), kQueueInitialSize),
1985 isolate_(isolate) { 1985 isolate_(isolate) {
1986 } 1986 }
1987 1987
1988 1988
1989 Debugger::~Debugger() { 1989 Debugger::~Debugger() {
1990 delete debugger_access_;
1991 debugger_access_ = 0;
1990 delete dispatch_handler_access_; 1992 delete dispatch_handler_access_;
1991 dispatch_handler_access_ = 0; 1993 dispatch_handler_access_ = 0;
1992 delete command_received_; 1994 delete command_received_;
1993 command_received_ = 0; 1995 command_received_ = 0;
1994 } 1996 }
1995 1997
1996 1998
1997 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name, 1999 Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name,
1998 int argc, Object*** argv, 2000 int argc, Object*** argv,
1999 bool* caught_exception) { 2001 bool* caught_exception) {
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
3126 { 3128 {
3127 Locker locker; 3129 Locker locker;
3128 Isolate::Current()->debugger()->CallMessageDispatchHandler(); 3130 Isolate::Current()->debugger()->CallMessageDispatchHandler();
3129 } 3131 }
3130 } 3132 }
3131 } 3133 }
3132 3134
3133 #endif // ENABLE_DEBUGGER_SUPPORT 3135 #endif // ENABLE_DEBUGGER_SUPPORT
3134 3136
3135 } } // namespace v8::internal 3137 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698