OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/base/gtk/owned_widget_gtk.h" | 5 #include "ui/base/gtk/owned_widget_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... | |
30 | 30 |
31 void OwnedWidgetGtk::Destroy() { | 31 void OwnedWidgetGtk::Destroy() { |
32 if (!widget_) | 32 if (!widget_) |
33 return; | 33 return; |
34 | 34 |
35 GtkWidget* widget = widget_; | 35 GtkWidget* widget = widget_; |
36 widget_ = NULL; | 36 widget_ = NULL; |
37 gtk_widget_destroy(widget); | 37 gtk_widget_destroy(widget); |
38 | 38 |
39 DCHECK(!g_object_is_floating(widget)); | 39 DCHECK(!g_object_is_floating(widget)); |
40 // NOTE: Assumes some implementation details about glib internals. | |
41 DCHECK_EQ(G_OBJECT(widget)->ref_count, 1U); | |
Elliot Glaysher
2013/07/30 18:13:49
While I really really want this line gone (and is
Evan Stade
2013/07/30 22:08:50
This DCHECK is not spurious. It was intentionally
| |
42 g_object_unref(widget); | 40 g_object_unref(widget); |
43 } | 41 } |
44 | 42 |
45 } // namespace ui | 43 } // namespace ui |
OLD | NEW |