summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--o3d/core/cross/display_mode.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/o3d/core/cross/display_mode.h b/o3d/core/cross/display_mode.h
index e663803..623f7a6 100644
--- a/o3d/core/cross/display_mode.h
+++ b/o3d/core/cross/display_mode.h
@@ -70,10 +70,12 @@ class DisplayMode {
}
}
DisplayMode& operator=(const DisplayMode& mode) {
- if (mode.valid()) {
- Set(mode.width(), mode.height(), mode.refresh_rate(), mode.id());
- } else {
- valid_ = false;
+ if (&mode != this) {
+ if (mode.valid()) {
+ Set(mode.width(), mode.height(), mode.refresh_rate(), mode.id());
+ } else {
+ valid_ = false;
+ }
}
return *this;
}