]> git.saurik.com Git - wxWidgets.git/blame - src/common/clipcmn.cpp
Correct weak ref usage which triggered an assert
[wxWidgets.git] / src / common / clipcmn.cpp
CommitLineData
b068c4e8 1/////////////////////////////////////////////////////////////////////////////
02761f6c 2// Name: src/common/clipcmn.cpp
b068c4e8
RR
3// Purpose: common (to all ports) wxClipboard functions
4// Author: Robert Roebling
5// Modified by:
6// Created: 28.06.99
7// RCS-ID: $Id$
8// Copyright: (c) Robert Roebling
65571936 9// Licence: wxWindows licence
b068c4e8
RR
10/////////////////////////////////////////////////////////////////////////////
11
12// ============================================================================
13// declarations
14// ============================================================================
15
16// ----------------------------------------------------------------------------
17// headers
18// ----------------------------------------------------------------------------
19
b068c4e8
RR
20// For compilers that support precompilation, includes "wx.h".
21#include "wx/wxprec.h"
22
23#ifdef __BORLANDC__
24 #pragma hdrstop
25#endif
26
02761f6c
WS
27#if wxUSE_CLIPBOARD
28
b068c4e8
RR
29#include "wx/clipbrd.h"
30
02761f6c
WS
31#ifndef WX_PRECOMP
32 #include "wx/module.h"
33#endif
41b1047d 34
5dc43d1f
VS
35static wxClipboard *gs_clipboard = NULL;
36
37/*static*/ wxClipboard *wxClipboardBase::Get()
38{
39 if ( !gs_clipboard )
40 {
41 gs_clipboard = new wxClipboard;
42 }
43 return gs_clipboard;
44}
45
b068c4e8 46// ----------------------------------------------------------------------------
5dc43d1f 47// wxClipboardModule: module responsible for destroying the global clipboard
b068c4e8 48// object
b068c4e8
RR
49// ----------------------------------------------------------------------------
50
51class wxClipboardModule : public wxModule
52{
53public:
5dc43d1f
VS
54 bool OnInit() { return true; }
55 void OnExit() { wxDELETE(gs_clipboard); }
b068c4e8
RR
56
57private:
58 DECLARE_DYNAMIC_CLASS(wxClipboardModule)
59};
60
d54598dd 61IMPLEMENT_DYNAMIC_CLASS(wxClipboardModule, wxModule)
8ee9d618 62
41b1047d 63#endif // wxUSE_CLIPBOARD